A federal judge threw out four bribery counts in U.S. Sen. Bob Menendez's corruption case on Monday but rejected claims by Menendez and a co-defendant that prosecutors presented false testimony to grand jurors and misused a law that's central to the case.

The dismissed counts, two each against Menendez and Florida eye doctor Salomon Melgen, a longtime friend, stemmed from two $20,000 donations made by Melgen to a legal defense fund for Menendez.

The 22-count indictment unsealed last spring charged the longtime Democratic congressman with accepting campaign donations and gifts from Melgen in exchange for official action on behalf of Melgen's business interests. Menendez initially faced 14 counts and Melgen faced 12, and they pleaded not guilty.

Defense lawyer Abbe Lowell said the New Jersey senator, who plans to appeal, has always stated he acted in accordance with the law and believes he'll be exonerated.

"We appreciate that the Court dismissed several counts in the indictment that we challenged," he said in a written statement.

U.S. District Judge William Walls had yet to rule Monday evening on several additional motions filed by the defendants to dismiss parts of the indictment.

But he denied one of Menendez's central arguments: that the indictment should be thrown out because his actions on behalf of Melgen, in a Medicare dispute and a business deal in the Dominican Republic, were routine legislative work protected by the Constitution's speech or debate clause. That law shields elected officials from being questioned by prosecutors about legislative work.

The judge cited numerous communications between Menendez or his staffers and government officials to conclude that the government had adequately alleged the facts in the indictment, leaving it for a jury to decide at trial.

"Menendez fails to meet his burden to demonstrate that the primary goal of these communications was not to lobby the Executive Branch to enforce Dr. Melgen's specific contract, a non-legislative activity," the judge wrote.

Similarly, he denied the defendants' motion to dismiss the indictment on the grounds that Melgen's campaign donations to Menendez were protected by the First Amendment.

"The Constitution does not protect an attempt to influence a public official's acts through improper means, such as the bribery scheme that has been alleged in this case," he wrote.

The judge did, however, rule that the fund to which Melgen donated, The Fund to Uphold the Constitution, wasn't an entity that benefited Menendez's 2012 Senate campaign and that the indictment didn't allege an explicit agreement between the two men tied to the donations.

The judge also denied Menendez's claims that prosecutors improperly presented to the grand jury evidence that should have been protected by the speech or debate clause and gave grand jurors improper instructions on the law.

A spokesman for the Department of Justice declined comment on the rulings. An attorney representing Melgen didn't return an email late Monday seeking comment.

A trial initially was scheduled for next month but is expected to be delayed by several months due to appeals of the judge's rulings.