Shirakawa's lawyers told the judge the sudden filing of the new charge violated a plea deal that was reached with their client; a deal that resolved all investigations against him.
Judge Phillip Pennypacker seemed stunned as well, saying he thought the plea deal would quote, "cover everything."
The disgraced former supervisor has already been convicted of twelve criminal counts for lying on campaign finance reports and gambling with public funds.
In March he pleaded guilty to five felony counts and seven misdemeanors.
Prosecutors reached a plea deal where Shirakawa would spend a year in county jail, make reimbursements, and pledge never to run for office again.
But on Wednesday, in a bizarre twist, the district attorney filed a new and entirely different case against the disgraced former supervisor.
He's now charged with crimes related to an illegal campaign mailer mailed out three years ago during a race for a San Jose City Council seat between his former aid Xavier Campos and opponent Magdelena Carrasco.
Prosecutors say a routine DNA swab taken when Shirakawa was first arrested in March came back with a hit from the state DNA data bank
His DNA was found on a postage stamp on one of the campaign hit pieces aimed at discrediting Carrasco.
Prosecutors argued Friday that this new charge was never discussed as part of the plea agreement. And that they were within their rights to file it separately.
"No one was thinking about this case, and we were surprised as anyone when the database hit from the state came back identifying Mr. Shirakawa," Santa Clara County Deputy District Attorney Karyn Sinunu-Towery said.
Defense attorney Stephen Clark, who is not involved in the Shirakawa case, says the judge has some thorny issues before him.
"To throw a new charge in at this late stage is unfair," he said. "It violates his due process rights, and that's what the judge is going to have to sort out."
They all come back to court in July, hopefully with some answers to very complicated legal questions.