The unexpected announcement was greeted with cheers and applause from spectators at Mosby's outdoor news conference. On the streets, motorists honked their horns in approval. Twitter was abuzz with word of the decision.
Mosby urged the public to remain calm.
"To the people of Baltimore and demonstrators across America, I heard your call for 'No Justice, No peace,'" she said. "Your peace is sincerely needed as I work to deliver justice on behalf of this young man."
Gray, 25, died in police custody April 19 from a fatal spinal cord injury, one week after he was arrested.
Mosby, 35, who comes from a long line of police officers, including her grandfather, four uncles and her mother, assumes a key role in the latest case to draw national attention to the issue of relations between police officers and the communities they are sworn to serve.
"To the rank-and-file officers of the Baltimore City Police Department, please know that the accusations of these six officers are not an indictment on the entire force," she said Friday.
Mosby noted that her grandfather, who died recently, was a founding member of the first African-American police organization in Massachusetts.
"I can tell you that actions of these officers will not and should not in any way damage the important working relationships between police and prosecutors as we continue to fight together to reduce crime in Baltimore," she said.
Freddie Gray's mysterious death has turned the largely black city near the nation's capital into a tinderbox where mostly peaceful demonstrations on Monday erupted in pockets of looting and rioting in the hours after Gray's funeral.
A 10 p.m. citywide curfew was put into effect days ago, and National Guard troops have joined Baltimore police in an attempt to maintain order.
On Thursday, as police handed their investigative files
over to the state attorney's officer a day earlier than planned, supporters of the former insurance company lawyer expressed confidence in Mosby's ability to handle the volatile case.
'We have much more confidence in her'
"We're enthusiastic about the new prosecutor," said William "Billy" Murphy Jr., a former Baltimore judge who is now the lead attorney for Gray's family. "She comes to the office with a belief in the integrity of these kinds of investigations. We have much more confidence in her than we have in the police because there's never been any level of confidence, nor should there be, in the police investigating themselves."
Mosby said that while police have regularly briefed her office on their findings, her team has been conducting its own independent probe into the death.
"We ask for the public to remain patient and peaceful and to trust the process of the justice system," she said.
Mosby is married to Baltimore City Councilman Nick Mosby, who represents areas of West Baltimore where riots erupted earlier this week. The couple have two young daughters.
"She's a strong woman," Nick Mosby told CNN. "She was built for this ... I was at church service the other day and they were talking about being at the right place with the right person at the right time. I know her heart has always been convicted to ensure that justice will be served fairly and equally across the board."
Cousin's death brought exposure to criminal justice system
During her campaign, Mosby spoke about the broad-daylight shooting death of her 17-year-old cousin on her front doorstep.
"I learned very early on that the criminal justice system isn't just the police, the judges and the state's attorney," she said. "It's much more than that. I believe that we are the justice system. We, the members of the community, are the justice system because we are the victims of crimes."
Mosby said her cousin's 1994 murder was her first introduction to the criminal justice system.
"Having to go to court and deal with prosecutors," she said. "Having to go to court and see my neighbor who had the courage and audacity to cooperate with the police ... to testify in court and the way the district attorney's office treated my family is something that inspired me."
Mosby, who grew up in Boston, is the youngest chief prosecutor of any major city in the United States, according to the state's attorney's website.
At the age of 6, Mosby was accepted in a school desegregation program in Massachusetts. She later participated in a study of the civil rights movement.
"After having that awesome experience I knew I wanted to be an attorney," she said during her campaign.
A. Dwight Pettit, a civil rights attorney and Mosby supporter, said she will "deliver on doing it right, and getting it right. I'm confident in that."
"She's very dedicated and part of what she campaigned on was bringing integrity to the office, and so I believe that she will move in a methodical way," he said. "And I think that she will follow where the evidence leads. I do not think she will follow just public opinion."
Prosecutor said it's time to rebuild trust
When she was sworn in as chief prosecutor earlier this year, Mosby brought up the lack of trust between the community and police.
"Our time to repair that trust, to come together collectively as a community to start to break down the barriers to progress in our communities is now," she said.
Mosby added, "As a black woman who understands just how much the criminal justice system disproportionately affects communities of color, I will seek justice on your behalf."
Mosby is African-American, as are Mayor Stephanie Rawlings-Blake, Police Commissioner Anthony Batts and other leading Baltimore officials. Although about 63% of Baltimore's population is black, they face stunning disparities
when it comes to income, employment, poverty, housing, incarceration and overall health.
The people on Mosby's transition team included former Mayor Kurt Schmoke, former congressman and NAACP president Kweisi Mfume, and Murphy, who represents Gray's family.
Murphy last year donated a total of $5,000 to Mosby's campaign, according to Maryland campaign reporting records.
Schmoke, a former state's attorney and Baltimore's first African-American mayor, said Mosby's background will buy her time with a tense community anxious for justice.
"I actually think that the level of patience will actually increase primarily because the state's attorney, Marilyn Mosby, was recently elected," he said. "She has a level of credibility with the community that will allow for that patience."
Mosby defeated Gregg Bernstein as state's attorney in a 2014 election.
"Baltimore prosecutors get to see it all in court -- we've got the toughest job in America," she said in a statement after the election.
Mary Koch, another attorney for Gray's family, said the new chief prosecutor has her work cut out for her.
"The family wants the truth and they want it to be arrived at very carefully and that's not going to be an easy job for Ms. Mosby," said Koch, adding: "That's her job. That's the job she took on."