A Baltimore judge has ruled that a police officer facing charges stemming from the death of Freddie Gray must testify against his fellow officer at an upcoming trial.

Baltimore Circuit Judge Barry Williams ruled Wednesday that William Porter, whose trial ended in a mistrial last month, can be compelled to take the stand in the trial of wagon driver Caesar Goodson. Goodson is facing the most serious charge of the six officers charged in the case.

Porter had previously said he planned to invoke his Fifth Amendment right against self-incrimination if called to the stand. Now, if he does, he can be held in contempt of court.

Porter's attorney Gary Proctor says he plans to ask an appeals court to overturn the ruling before Monday, when Goodson's trial is scheduled to begin.