A judge on Monday tossed out the latest racketeering and money laundering charges against John "Junior" Gotti, but the son of the late mob boss still faces trial on charges alleging he ordered the beating of Guardian Angels founder Curtis Sliwa.

The ruling by U.S. District Judge Shira Scheindlin was a blow to the government just weeks before Gotti's third trial on racketeering charges. Juries deadlocked at two previous trials in the last year.

Click here to visit FOXNews.com's Crime Center

In May, the government brought new charges of racketeering, witness tampering and money laundering to counter Gotti's contention in 1999 that he left the mob in the late 1990s.

In throwing out the new racketeering and money laundering charges, the judge noted that Gotti pleaded guilty to racketeering in 1999 and that charges identical to some of the new ones were dismissed by the government after Gotti satisfied the terms of his plea agreement.

"The plea agreement cannot be both a sword and shield," she wrote.

Lauren McDonough, a spokeswoman for prosecutors, said there was no comment.

A call seeking comment from Gotti's lawyer, Charles Carnesi, was not returned.

The judge said the government had also argued that Gotti used money from his racketeering activities to operate two corporations he formed in the early 1990s.

"The problem with this second theory is that it is based on nothing but surmise, speculation and conjecture," Scheindlin said.

The government alleges that Gotti ordered a baseball bat beating of Sliwa and a kidnapping several weeks later that ended with Sliwa being shot three times before he dived out of a moving taxi. Sliwa recovered.

If convicted at trial, scheduled to start Aug. 21, Gotti could face up to 30 years in prison.