NEWARK, N.J. — A federal judge expressed deep skepticism Wednesday about a fundamental component of the bribery case against Democratic U.S. Sen. Robert Menendez even as he signaled he would allow the trial to proceed to the jury.

After prosecutors rested their case in the sixth week of the trial, District Judge William H. Walls said he thought the government had met a key threshold established by the Supreme Court last year regarding what constitutes an "official act" taken by a public official in exchange for a bribe.

But, he told them, "I have questions about your linkage" between the gifts Menendez is accused of soliciting and receiving from a Florida eye doctor and those official acts.

"What I want to know is, what's the quid for those quos, or vice versa?" Walls asked during four hours of legal arguments that started when the defense took the expected step of asking the judge to rule that prosecutors had not proven their case.

Menendez's attorneys cited the 2016 Supreme Court ruling that overturned the conviction of former Virginia Gov. Bob McDonnell and reshaped the landscape for corruption cases across the country, raising the bar for what are considered "official acts."

Legal experts largely doubted that Menendez would prevail on that point, but Walls' comments raised the prospect that at least a piece of the prosecution's case may fall short.

The judge didn't issue a ruling, and asked both sides to file written arguments on the matter. The jury, which had been excused for the day before the arguments began, is scheduled to return Monday.

Prosecutors called 30 witnesses in their bid to prove that Menendez advocated for Salomon Melgen's personal and financial interests over several years in exchange for free trips on Melgen's jet, vacations at his villa in the Dominican Republic, and $750,000 in political donations. The senator and doctor, a co-defendant, say their friendship undercuts the government's bribery theory.

Hanging over the trial from the outset was the possible impact of the McDonnell decision, which set a new standard for bribery prosecutions. That high court ruling found that setting up meetings or making phone calls was no longer enough to constitute an official act that could be part of a quid pro quo.

Former New York Assembly Speaker Sheldon Silver cited the ruling to overturn his conviction in July. Then, Dean Skelos, the New York state Senate's former majority leader, got his conviction thrown out in September. And last week a federal judge threw out convictions on seven of the 10 charges against former Louisiana Rep. William Jefferson, who kept $90,000 cash intended as a bribe in his freezer. New sentences were ordered on the remaining three charges.

During Wednesday's arguments, Abbe Lowell, an attorney for Menendez, told the judge the senator lacked the authority to commit the official acts Melgen allegedly sought. Only the executive branch members Menendez met with and lobbied, Lowell said, had that authority.

"I don't buy that argument," Walls responded. "Senators have great power. They affect other members of other branches, other than judicial."

Menendez, according to prosecutors, called a U.S. ambassador to help Melgen's friends obtain visas; met with high-level officials, including Health and Human Services Secretary Kathleen Sebelius, to change the outcome of Melgen's $8.9 million Medicare billing dispute; and threatened an assistant secretary of state that he'd hold Senate hearings if the official didn't resolve Melgen's pending dispute with the Dominican Republic over a port-screening contract.

The case is being closely watched because of its potential political and legal implications. Randall D. Eliason, a former prosecutor, said the key difference between McDonnell's case and this one is that instead of just setting up meetings or making phone calls, as McDonnell did, Menendez appears to have advocated for specific outcomes.

"The prosecutors are alleging Menendez actively worked to influence decisions on particular matters," Eliason said. "He was actually pushing people to resolve particular questions and issues, and working on it himself."

In the Medicare fight, Menendez lobbied officials at the highest level of the Department of Health and Human Services in an attempt to change reimbursement policy, witnesses have testified. Prosecutors say Menendez's goal was to help Melgen, but the senator's attorneys have elicited testimony suggesting he was concerned about policy issues.

Menendez eventually took his arguments to Sebelius.

This "climbing the chain of command" could show that "Sen. Menendez was working hard to find somebody who could produce the official act that the gift-giver, the doctor, was seeking out," said Scott Resnik, a former federal prosecutor in New Jersey who is now a criminal defense attorney with Katten Muchin Rosenman LLP in New York.

"It's Menendez trying to put his thumb on the scale at the right pressure point to get the results that the doctor wants," Resnik said.

The judge's remarks Wednesday were not all favorable to the prosecution. He said he doubted that the legal theory underpinning the government's bribery charges was still valid in light of the McDonnell decision.

"If stream-of-benefits still lives, then you've got a chance," Walls told Peter Koski, a prosecutor with the Justice Department, referring to the legal theory. In any case, Walls said, prosecutors will have a shot at convicting Menendez on charges that he failed to disclose gifts on his financial disclosure forms.

Walls said he was having trouble tying any single gift — such as a flight — to an official act.

Another difference with previous convictions that have been overturned is that those were reversed largely because the jury instructions were seen as too broad once McDonnell narrowed the definition of official acts. In this case, however, the jury instructions can be written to account for the new standard, Eliason said.

Former Rep. Chaka Fattah, a Philadelphia Democrat, also is citing McDonnell in trying to overturn his 2016 corruption conviction.