A U.S. District Judge dismissed seven counts of bribery charges on Wednesday in the corruption case against Sen. Bob Menendez, D-N.J., ruling that the government failed to prove that there was an explicit quid-pro-quo agreement.

The case against Menendez alleged that he had conversations and meetings with executive branch officials to help his longtime friend, Florida eye doctor Salomon Melgen, in a $9 billion Medicare billing dispute and a contract in the Dominican Republic involving one of his companies.

The counts dropped on Wednesday alleged bribery involving political donations to the New Jersey Democrat by Melgen.

Defense lawyers argued that those donations had to be linked to specific acts by the senator in order to be considered bribes.

The judge agreed with the defense and tossed out seven counts against Menendez and Melgen.

"The failure of the Government to produce evidence of facts either direct or circumstantial as predicates for proffered inferences evokes Gertrude Stein's celebrated critique of her hometown, Oakland: 'There is no there there,” Walls wrote.

Menendez's attorney, Abbe D. Lowell, said he hopes the Justice Department will reconsider retrying the case considering the court's recent ruling.

"With the court's decision, this case is now solely about the purest of personal hospitality allegations," Lowell said. "A jury rejected the government's facts and theory of bribery, and now the trial judge has rejected a critical legal theory on which the case was brought. The decision of the DOJ to retry the case makes even less sense than it did last week and we hope it would be reconsidered."

Walls' ruling also rejected Menendez's and Melgen's argument to dismiss the rest of the case because, in their view, a 2016 Supreme Court ruling invalidated the so-called "stream of benefits" theory of bribery — referring to gifts given over a period of time.

Menendez and Melgen still face 11 counts including bribery and fraud. Menendez faces one count of making false statements for allegedly lying on Senate disclosure forms.

The first trial ended in a hung jury last fall. The government said last week it will retry the pair. A new trial date hasn't been set.

Fox News' Whitney Ksiazek and The Associated Press contributed to this report.