Prosecutors on Monday dismissed a criminal charge against Missouri Gov. Eric Greitens, bringing a sudden halt to his trial just before it was set to begin and with jury selection already underway.

St. Louis Circuit Attorney Kimberly Gardner dropped the felony invasion-of-privacy charge stemming from allegations that Greitens took a nude photo of a woman without her consent. The decision came after a judge ruled that the governor’s lawyers could potentially call Gardner as a witness in the trial.

“It’s a great victory and it has been a long time coming,” Greitens, 44, a Republican and a former Navy SEAL, told reporters after his case was dismissed. The governor has repeatedly denied any criminal wrongdoing and dismissed widespread, bipartisan calls for his resignation.

But Greitens’s political and criminal troubles aren’t over. The circuit attorney said she intends to refile the charge and may appoint a special prosecutor or one of her assistants to pursue the case. Greitens still faces another felony charge of computer tampering tied to allegations that he improperly used a veterans’ charity donor list to raise funds for his 2016 campaign for governor.