The high-profile case led to Kerns' resignation in the fall from his GOP post and law partnership, then collapsed after missteps by county prosecutors. It was revived in late April by the state Attorney General's Office.
Deputy Attorney General Daniel J. Dye said he was ready to proceed with the remaining charges, which he called the strongest to bring to trial. The judge's decision to dismiss the two charges "doesn't impact our prosecution at all," he said.
The alleged victim, who was in the court offices but not in the courtroom, "is ready for trial," he said.
The ruling came after Teyral reviewed the transcript of a hearing in which the alleged victim testified - when charges were brought by the Montgomery County District Attorney's Office - and met privately with McMonagle and Dye to talk about which parts of that testimony no longer were relevant.
State prosecutors took over the case after District Attorney Risa Vetri Ferman acknowledged that her office had misread a lab report and wrongly charged Kerns with intentionally drugging the woman before raping her.
Ferman, who used a grand jury investigation to build the case, withdrew all charges. Still, she said she stood by the accusations and referred the case to the office of Attorney General Kathleen G. Kane, which refiled rape and assault charges against Kerns, of North Wales.
Teyral, a former York County district judge who was enlisted to preside over the case, did not explain why she dismissed the counts.
Stephanos Bibas, a professor of law and criminology at the University of Pennsylvania Law School, said rape charges require evidence of intercourse, which can be difficult to prove.
The alleged attack occurred after an Oct. 25 office party at a Blue Bell restaurant. At the time, the woman was an employee of the Lansdale firm where Kerns was a partner.
At the party, according to a court document, Kerns bought the woman several drinks, then offered to drive her to the King of Prussia mall, where she wanted to shop. Once she was in his car, the document says, Kerns gave her wine and then assaulted her - once in the car and once in her house after he had driven her home.
Kerns' formal arraignment in Montgomery County Court is scheduled for July 30.