BALTIMORE (AP) — Baltimore's chief prosecutor, just 35 years old and on the job for less than four months, moved swiftly Friday to address the biggest challenge of her career when she announced charges including second-degree murder against six officers in the death of Freddie Gray.

State's Attorney Marilyn Mosby surprised legal observers by filing charges against the officers herself, rather than seeking a grand jury indictment, a day after receiving the results of the internal police investigation and an official autopsy report.

The decision, however, was consistent with her campaign pledge to hold police accountable.

"It is surprising because many prosecutors would calculate that there is less risk of alienating the police by putting this in the hands of the grand jury, and she did not do that," said Andrew Levy, a longtime Baltimore defense attorney and an adjunct professor at the University of Maryland School of Law.

Mosby ousted an established white opponent last year, accusing him of being too cozy with police officers and too out of touch with the citizens of Baltimore. Mosby and her husband, a Baltimore city councilman, are black and live just blocks from the poverty-stricken community where riots broke out Monday following Gray's funeral.

"She better be ready. It's going to be baptism by fire," said J. Wyndal Gordon, a defense attorney in Baltimore who has litigated against officers in excessive-force cases. "How she will handle this will define her administration and the future of that office."

Residents who've taken to city streets in protest of Gray's death were elated by Mosby's decision. Terry Simms, 32, who owns a landscaping company, attended a rally outside Baltimore's booking facility on Friday afternoon with a handwritten sign that read, "Marilyn Mosby for Mayor." Simms said he wept with joy when she announced the charges.

"We've got to get her in this office so she can fix the whole city," he said. "The city needed some resolution. If this didn't happen, it would have been real bad, real quick. What she did today eased all the tension."

Before the charges were announced, the Baltimore police union president told Mosby in a letter that none of the six officers were responsible for Gray's death. The union requested a special prosecutor in the case, saying Mosby had conflicts of interest including a friendship with the Gray family's lawyer, who contributed to her campaign.

Mosby grew up in Boston and met her husband, Councilman Nick Mosby, while they were students at Tuskegee University in Alabama. After clerking at U.S. Attorney's offices in Boston and Washington, she joined the Baltimore State's Attorney's Office in 2005 and moved up the ranks before leaving to work for an insurance company. She defeated incumbent Gregg Bernstein, who outraised her three-to-one, in last June's Democratic primary, and faced only write-in opposition in the general election.

Her official biography declares that "she is the youngest chief prosecutor of any major city in America."

"I think it's very unique that a chief prosecutor who — as young as she is, who lives in a community that has a high amount of violence — that's very unique and she's probably the only one in the entire country," Nick Mosby said. "She's from the inner city, she lives in the inner city, she knows the inner city."

In announcing the charges against the officers, Mosby also stressed her personal ties to police, noting that her parents, grandfather and other relatives were police officers.

Some of her critics, however, say her campaign pledges and political success could compromise justice in the Gray case.

Warren Brown, a veteran Baltimore defense attorney who supported Mosby's opponent, said Mosby's handling of the Gray case would be inextricably linked to her and her husband's political aspirations. He said Mosby was being pressured to charge the officers with murder, which he doesn't think the evidence supports.

Brown and Ivan Bates, a former prosecutor and a current defense attorney in Baltimore, both expressed concerns about Mosby's ties to the attorney representing Gray's family, Billy Murphy.

Murphy was among Mosby's biggest campaign contributors last year, donating the maximum individual amount allowed, $4,000, in June. He was also on Mosby's transition team after the election, and Bates described him as a mentor to her.

"I think she has too much pressure to not indict, from the pressure of her husband's constituents, of her mentor Billy Murphy, and of the pressure of making sure she wants to hold on to her job in four years," Bates said.

When she was elected in November, Mosby told The Daily Record newspaper she was excited for the opportunity "to change what has happened in the community."

"I'm living out my dream to reform the criminal justice system," Mosby said.

Mosby's record in high-profile cases has been mixed thus far.

In January, the morning after she was sworn into office, she announced manslaughter charges against an Episcopal bishop in the hit-and-run death of a cyclist. The bishop, Heather Cook, had not even been arrested when Mosby told a packed news conference that Cook had been drunkenly text-messaging at the time of the crash.

Mosby failed, however, to obtain a third trial for a man accused in the slaying of a teenage honor student from North Carolina. Defense attorneys said the re-indictment violated Constitutional protections against double jeopardy, and a judge threw it out. Her office is pursuing an appeal.

___

Follow Ben Nuckols on Twitter at https://twitter.com/APBenNuckols .

Follow Amanda Lee Myers on Twitter at https://twitter.com/AmandaLeeAP .