[Update: This story was updated at 4 p.m.]

Six Baltimore police officers will face charges ranging from manslaughter to second-degree murder in the death of Freddie Gray, the city’s top prosecutor announced Friday.

Mr. Gray was fatally injured in police custody on April 12. Officers pursued him when he fled after making “eye contact” with police at a West Baltimore corner. He was dragged hand-cuffed into a police van, and carried unrestrained for about 45 minutes, with several stops. Police declined Gray’s calls for medical assistance during the ride.

A medic was finally called to attend to the prisoner upon his arrival at Western District police headquarters. Gray died April 19.

“Mr. Gray’s death was a homicide,” said Baltimore State’s Attorney Marilyn Mosby in announcing the charges.

The second-degree murder charge was levied against the police van driver. Other officers faced lesser charges.

Gray’s arrest was illegal, said Ms. Mosby. Though booked on charges of carrying a switchblade, the knife clipped inside his pocket was in fact legal, said Mosby.

In a forceful press conference, the prosecutor said that she comes from generations of police officers and that her charges against law enforcement officials should not strain relations between police and prosecutors, who work together every day to try and keep the city safe.

But the cries of protesters for justice necessitated her move, she said.

“To the youth of this city, I will seek justice on your behalf ... as young people our time is now,” said Mosby.

Baltimore has been the scene of large-scale protests since April 18, when Gray was still in a coma. On Monday, after Gray's funeral, the protests turned violent, with people throwing rocks at police, burning cars, and looting local businesses.

The Baltimore Police Department on Thursday said that 98 officers had been injured since the riots broke out on Monday, 43 of them necessitating emergency medical treatment. Ninety-five people have been arrested. The protests over Gray's death have gone nationwide this week, with marches in cities from Boston to Denver.

Gray's death has been the latest in a series of high-profile incidents, where young black men have died in police custody, sparking protests from Long Island, N.Y. to Ferguson, Mo., to Madison, Wisc.

The short-term effect of the prosecutor’s swift move to press charges could be to lower the heat on scheduled protests in the city. At least one large march to City Hall is set for Saturday and that could have forced Mosby’s hand.

Cars driving through the intersection of Pennsylvania and North Avenues, the center of Monday’s protest zone, honked their horns in celebration. Outside the CVS that burned Monday night, people had gathered again – this time in celebration.

“I feel very good. Justice is served. No more outbreaks of violence after this,” says Terrence Noble, a 20something who lives within walking distance of the CVS. “All we want is justice. This is a step.”

We just want peace, we don’t want no trouble. I’m feeling good, because I know these question have to be answered now. And if it’s gonna answer in Baltimore, it’s gonna answer in other different states.

Stafford Sutton, a clergyman with the Columbia Church of God in Christ, said that Friday's charges allow "us to have hope."

Mr. Sutton says he hopes the next step will be reforms in policies and procedures governing arrests and police use of force. He says the prevalence of smart phones is bringing what he sees as a longstanding nationwide issue to light.

“Thank God for the camera,” he says.

“People are out in the streets not just because of Freddie Gray,” Sutton says. “They’ve been seeing it all their lives and nothing happens.”

Social media was filled with Baltimore residents praising the quick move. But for prosecutor Mosby, the move could be a high-risk, high-reward situation. At 35 years of age, she is one of the youngest top big city prosecutors in America. She won election last November in an upset, beating an entrenched incumbent who had much more campaign cash but appeared to coast toward Election Day.

If she loses the cases, she’ll be criticized for rushing to judgment. On Fox News conservative commentator Todd Starnes has already complained she’s leading a “war on law enforcement.”

But if she wins she will be a political star. Her public appearance on Friday was crisp and forceful in a way that Mayor Stephanie Rawlings-Blake has not managed.

Ms. Rawlings-Blake, a former City Council chairman, is something of an accidental mayor, having first risen to the position following the resignation of ex-Mayor Sheila Dixon following a corruption conviction. It’s possible she could lose to a more emotional and populist challenger.

On Twitter some were already gushing that Hillary Clinton should pick Mosby for her running mate. Others called her their new “favorite Avenger.”

“Folks, a star was just born,” tweeted MSNBC commentator Jonathan Capehart in response to Mosby’s appearance.

Folks, a star was just born. — Jonathan Capehart (@CapehartJ) May 1, 2015

For some Baltimoreans, Friday's charges offer the prospect that life in the city can return to normal.

Daisy Bush, owner of D&D Variety Store on Pennsylvania, said her store wasn't looted on Monday night, but that the experience was terrifying.

"It was so scary when Monday came," she said. "I’ll never forget this moment. So it is something. Something to remember. At least the people standing up for justice. It’s all about justice, you know?"

Ms. Bush said she was looking forward to businesses being able to reopen to customers and was one of several Baltimore residents interviewed who expressed a hope that the city would be able to return to everyday life by next week.

Terrence Bert has been among those protesting Gray's death all week. The longtime Baltimore resident said that he believes problems with Baltimore police have gotten worse in recent years. Of Friday's charges, he said, "It was past due for that to happen."

But Mr. Bert said he was saddened by the riots that gripped his city Monday night.

“It made Baltimore look really bad. This is a beautiful city,” he said. “I just want everything back to normal.”

Correspondent Mary Wiltenburg contributed to this report from Baltimore.