BALTIMORE (Reuters) - A Baltimore police officer will face retrial on a manslaughter charge over the death of black detainee Freddie Gray starting on June 13, a Maryland judge ruled on Monday, after the officer’s first trial ended in a deadlocked jury.

Officer William Porter arrives at the courthouse in Baltimore, December 16, 2015. REUTERS/Algerina Perna/The Baltimore Sun/Pool

Judge Barry Williams set the trial date after meeting prosecutors and defense lawyers, the Maryland state courts office said in a statement.

Gray’s death in April caused protests and rioting in the majority black city of 620,000 people and intensified a U.S. debate on police treatment of minorities.

The date for the retrial of Officer William Porter, 26, in Baltimore City Circuit Court could snarl prosecutors’ strategy to use him as a key witness against other officers in the high-profile trial, legal analysts said.

Porter, who is also black, was the first of six officers to be tried in connection with Gray’s death from a broken neck sustained while in police custody.

Gray was arrested after fleeing from police. He was put in a transport van, shackled and handcuffed, but was not secured by a seat belt, in violation of department policy. He died a week later.

A jury was unable to reach a decision last week and Williams declared a mistrial. Porter faces charges of involuntary manslaughter, second-degree assault, reckless endangerment and misconduct in office.

The trial of van driver Officer Caesar Goodson, who faces the most serious charge of second-degree depraved heart murder, is set to begin on Jan. 6.

Prosecutors had hoped to convict Porter and use him as a witness against Goodson and Sergeant Alicia White. Porter testified he passed Gray’s request for medical help to them but none was summoned.

David Jaros, a University of Baltimore associate law professor, said that Porter was a potentially major witness against Goodson and without him prosecutors “know that the case against Officer Goodson is significantly weakened.”

Jim Cohen, a law professor at New York’s Fordham University, said prosecutors were facing a major difficulty since Porter could want immunity from prosecution to testify.

But prosecutors had labeled Porter a liar, giving the defense a perfect tool to use against him as a witness, Cohen said.

“I think they’ve got a big problem, whether it (the retrial) is set for June of ‘16 or June of ‘18,” he said.