Six Baltimore police officers face charges in the death of Freddie Gray. Top row, from left, are Officer Caesar R. Goodson Jr., Officer Edward M. Nero and Officer Garrett E. Miller. Bottom row, from left, are Officer William G. Porter, Lt. Brian W. Rice and Sgt. Alicia D. White. Baltimore Police Department/Handout/Reuters

A Maryland judge ruled on Wednesday that a second Baltimore police officer must testify against two other officers also charged in the death of Freddie Gray a year ago.

The ruling by Baltimore City Circuit Judge Barry Williams to grant the prosecutors' motion means that Officer Garrett Miller must take the witness stand in the case that has drawn attention to police treatment of minorities.

"The judge granted the state's motion" in a hearing that lasted about 15 minutes, a court spokeswoman said.

Miller will testify at the trial of Officer Edward Nero, which is scheduled to start on May 10, and that of Lieutenant Brian Rice, set for July 5.

Miller and Nero were involved in Gray's arrest in April 2015. They have pleaded not guilty to second-degree assault, reckless endangerment and two counts of misconduct.

Rice has been charged with manslaughter, second-degree assault, reckless endangerment and two counts of misconduct.

Gray, a 25-year-old black man, was arrested when he ran unprovoked from the officers and they found a switchblade knife on him. He was bundled into a transport van while shackled and died from a spinal injury a week later.

His death sparked protests and a day of rioting and arson, and stoked a U.S. debate on police tactics and treatment of minorities. Six officers have been charged in the case.

Williams' ruling came after legal wrangling over a prosecutors' bid to force another officer, William Porter, to testify under limited immunity with his own charges still pending. Porter's manslaughter trial ended in a hung jury in December.

Porter appealed Williams' ruling granting the prosecution's initial request to compel him to testify in one trial. Williams blocked prosecutors' request to call Porter at other trials.

Maryland's highest court ruled last month that Porter had to testify in the cases.