(CNN) A federal judge has acquitted New Jersey Sen. Bob Menendez and his friend Salomon Melgen of several charges, according to a new order filed Wednesday.
The order from Judge William Walls comes days after the Justice Department announced that it would retry its case against Menendez. The original trial, which took place in the fall of 2017, ended after the jury failed to reach a unanimous verdict on any of the 18 counts in the case.
Defense attorneys had refiled a motion for acquittal after the mistrial.
The charges on which they were acquitted focused on political donations made by Melgen, a wealthy ophthalmologist from Florida, to political funds, including a Super PAC, that supported Menendez. Prosecutors argued that the donations were in exchange for political favors from Menendez and attempted to tie the timing of the donations to "official acts" performed by the senator. For example, prosecutors tried to demonstrate a connection between a $60,000 donation to Menendez's legal defense fund and the New Jersey Democratic State Committee and a request by Menendez the same day to meet with Ambassador William Brownfield about a cargo contract dispute involving Melgen.
Melgen is also alleged to have bribed Menendez with flights on his private jet and a luxurious vacation to Paris. Menendez is also charged with making false statements in relation to his Senate financial disclosure forms. Those charges still stand in the case.
Both men deny all charges.
Walls wrote in a 50-page opinion that while political contributions can be the subject of a bribery case, the prosecution in this case did not demonstrate an explicit "quid pro quo" agreement between Menendez and Melgen in relation to Melgen's contributions.
CNN has also confirmed that Judge Walls told attorneys separately that he had recused himself from any further proceedings in the case.
Walls had been a colorful presence in the courtroom during the original trial, often making quips and film references, only to then strongly reprimand attorneys for their conduct or decisions in the courtroom.
Menendez attorney Abbe Lowell called on the Justice Department to reconsider its decision to retry the case.
"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," Lowell said. "With the court's decision, this case is now solely about the purest of personal hospitality allegations -- stays at his friend, Dr. Melgen's family home and reimbursed trips on a plane that Dr. Melgen was flying anyway."
"The court's acquittal on all counts which involve monetary contributions is long overdue," said Melgen's attorney Kirk Ogrosky. "There was simply never any quid pro quo agreement between my client and Senator Menendez, and the court has now acquitted these two longtime Hispanic-American friends on all counts that involved political contributions."
"The Justice Department is reviewing the court's order and considering next steps," said Justice Department spokeswoman Nicole Navas.