U.S. Sen. Bob Menendez U.S. Sen. Bob Menendez.

The Department of Justice said Wednesday it would not try U.S. Sen. Bob Menendez, D-New Jersey, and Florida eye doctor Salomon Melgen on corruption charges a second time after the first trial ended in a hung jury.

The department said its decision to dismiss the indictment against Menendez and Melgen was prompted by a Jan. 24 ruling by the judge who presided over the trial to dismiss seven of the 18 counts in the case. U.S. District Judge William Walls of the District of New Jersey had said that the trial revealed that evidence on those counts was weak.

Its decision not to proceed with a second trial is a 180-degree turn from the position the Justice Department took 12 days earlier, when it announced it would retry the case and requested an early trial date. The first trial ended in a hung jury in November 2017 after two months of deliberations, with the panel reportedly favoring acquittal by a margin of 10-2.

The decision by federal prosecutors means that Menendez can now pursue re-election without the burden of criminal charges hanging over his head. His seat is on the ballot for the 2018 elections.

The government's decision to drop charges indicates that its “stream of benefits” theory of liability lost out to the defendants' steadfast position that money, luxury accommodations and travel that Melgen furnished to Menendez was a consequence of their friendship.

The Department of Justice said in a brief statement that its decision to drop the prosecution of Menendez and Melgen was made “in light of the court's Jan. 24, 2018 opinion and order,” which threw out seven of the 18 charges in the case.

In that ruling, Walls granted motions for acquittal on charges linking contributions of $660,000 from Melgen to advocacy by Menendez with executive branch officials in connection with Melgen's port security business and a Medicare billing dispute. Walls said that the government “failed to prove an explicit quid pro quo regarding the political contribution counts.”

After the government's filing on Wednesday, Menendez and Melgen made a joint filing in court, saying that they “have no objection to the government's motion to dismiss the superseding Indictment.”

A statement by Menendez after the charges were dropped on Wednesday expressed thanks to his supporters.

“From the very beginning, I never wavered in my innocence and my belief that justice would prevail. I am grateful that the Department of Justice has taken the time to re-evaluate its case and come to the appropriate conclusion. I thank God for hearing my prayers and for giving me strength during this difficult time. I have devoted my life to serving the people of New Jersey, and am forever thankful for all who have stood by me. No matter the challenges ahead, I will never stop fighting for New Jersey and the values we share,” Menendez said.

Melgen's lawyer, Kirk Ogrosky of Arnold & Porter Kaye Scholer in Washington, said in a statement that the corruption probe and trial had taken a toll on his client.

“Five years ago today, FBI agents started this misguided case and destroyed our client's life when they raided his West Palm Beach medical office. Dr. Melgen is now, and has always been, innocent of the charges brought in New Jersey. He has never given anything to U.S. Sen. Robert Menendez, his best friend of over 20 years, with any expectation of getting anything in return. We are also grateful for the court's defense of the First Amendment when issuing its recent order of acquittals. We take no pleasure in seeing justice done so late in a case that should never have been filed. But justice today is certainly better than justice delayed if the prosecution had pushed the remaining counts forward, into what would have been an inevitable acquittal. We hope that the Department of Justice lives up to its name and never brings this type of meritless case again.”

The decision to drop the charges is also a big victory for Menendez's defense lawyers. His lead counsel, Abbe Lowell, also issued a statement Wednesday.

“In light of the results of a three-month trial, all the jury said and the granting of our motion for acquittal on significant counts, we are pleased and grateful that the Justice Department made the right decision to end this case. Despite the five years of this ordeal, Senator Menendez never wavered in his innocence and his commitment to the people of New Jersey. We were fortunate to be able to assist this honorable man,” Lowell said.

The Department of Justice, in a statement issued by spokeswoman Nicole Navas Oxman, said, “Given the impact of the court's Jan. 24 order on the charges and the evidence admissible in a retrial, the United States has determined that it will not retry the defendants on the remaining charges.”

The government's decision to drop the prosecution came after Jan. 22 when it accused defense counsel in the case of pursuing a jury nullification strategy, and improperly invoking the defendants' religion and ethnicity before jurors. Prosecutors had asked Walls to safeguard against such activity at the retrial.

Menendez and Melgen were indicted in 2015 on charges of bribery, fraud and conspiracy, and Menendez was also charged with making false statements by failing to include Melgen's gifts on Senate disclosure forms. The indictment cited multiple contacts by Menendez with executive branch officials to address a Medicare billing dispute and other business matters involving Melgen.

Melgen was separately convicted of Medicare fraud in Florida, and he faces a 30-year prison term.

Menendez had maintained that he should be found innocent under a 2016 U.S. Supreme Court ruling narrowing the definition of official acts under the bribery statute, which overturned the bribery conviction of Virginia Gov. Bob McDonnell.

The two-month trial included testimony from Kathleen Sebelius, former secretary of the Department of Health and Human Services, about Medicare policies. U.S. Sens. Cory Booker, D-New Jersey, and Lindsey Graham, R-South Carolina, testified on Menendez's behalf.

After the jury began deliberations, a juror who was excused due to vacation plans told the media that the panel was deadlocked. Walls declared a mistrial after finding the jury could not reach a consensus.