NEWARK, N.J. — A judge on Wednesday granted a request to acquit U.S. Sen. Bob Menendez and a longtime friend on seven of the corruption charges against them, altering the complexion of their pending retrial after the first trial ended in a hung jury last fall.

The resolved charges all dealt with alleged bribery involving political donations to the New Jersey Democrat by Florida eye doctor Salomon Melgen. Eleven charges remain, including bribery, fraud and conspiracy.

Defense lawyers had argued Melgen’s donations had to be tied to specific acts by Menendez to be considered bribes. That’s a higher standard than the one applied to gifts Melgen gave to Menendez over the years that are the basis for the bribery charges that remain.

U.S. District Judge William Walls’ ruling essentially overrode the jury, which couldn’t reach a verdict after several days of deliberations in November.

After the mistrial, several jurors said as many as 10 of the 12 panel members were in favor of acquittal, leading some experts to speculate the government wouldn’t pursue a retrial. No date for the retrial has been set.

“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,” Abbe Lowell, Menendez’s lead lawyer, said. “The decision … to retry the case makes even less sense than it did last week and we hope it would be reconsidered.”

A Department of Justice spokeswoman said the agency is reviewing the ruling and considering next steps.

The defense had sought to show during the trial that Melgen’s gifts, including trips on his private jet to his Dominican Republic resort, were a part of the pair’s longtime friendship that existed before and after the time period contained in the indictment.

Losing more than one-third of the charges in the indictment could cut more than one way for the prosecution in a retrial, said Rebecca Monck Ricigliano, a former federal prosecutor and first assistant attorney general in New Jersey.

“It can either help them by streamlining the case or it can hurt them if the evidence pursuant to those counts that was helpful to prove the other counts can no longer come in,” she said. “So they really have to evaluate their evidence to see if what they relied on before can be used in this new landscape.”

In his ruling, Walls wrote that the government failed to demonstrate in the seven charges that there was an explicit quid pro quo, or “this for that,” agreement.

Referring to two of the charges, Walls wrote, “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.'”

The indictment alleged Menendez had conversations and meetings with executive branch officials to help Melgen in a $9 million Medicare billing dispute, with visas for his reputed girlfriends and with a port security contract in the Dominican Republic involving one of his companies.

The defendants argued that Menendez’s actions were aimed at pursuing broader policy objectives and not to benefit Melgen specifically.

Walls’ ruling Wednesday also rejected Menendez’s and Melgen’s argument to toss 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.