U.S. Senator Robert Menendez urged the US Supreme Court Tuesday to throw out the federal corruption case pending against him.

Menendez, a New Jersey Democrat, was accused last year of using his Senate office to help a Florida eye doctor and big political donor, Salomon Melgen, who was under federal investigation over Medicare billing.

Abbe Lowell, a Washington, DC lawyer representing Menendez, said in the Supreme Court filing that the Constitution's "speech or debate" clause forbids federal prosecutors from challenging the motives of legislators engaged in official business.

"Agents of the executive branch may not hale members of Congress into court simply to impugn or even inquire into the motives underlying their official acts."

Senators such as Menendez cannot be required "to forfeit their immunity in the process of trying to claim it."

Related: Sen. Robert Menendez Indictment A Blow to Latino Political Influence

Prosecutors accused Menendez of urging federal officials to adopt reimbursement policies that would benefit Melgen, to honor a Dominican port security contract with a company in which Melgen was an investor, and to get visas for Melgen's girlfriends.

In return, the charges said, Dr. Melgen gave thousands in campaign contributions to Menendez and treated him to luxury Dominican vacations and private jet flights.

A federal appeals court in July ruled that the actions of Menendez could be considered lobbying and therefore outside the bounds of constitutional protection for legislative business. Menendez, the court said, had not met his burden of showing that his motives were purely official.

Lowell said other federal courts have concluded that "courts may never interrogate a legislator's motive to determine whether his acts are protected."

Sen. Menendez has been close friends with Dr. Melgen for over two decades, traveling together, celebrating holidays, exchanging gifts and consoling each other at times of loss, Lowell said.

Related: Former Virginia Governor Robert McDonnell Spared from Prison Sentence

In contrast to the federal case against former Virginia Gov. Robert McDonnell, which the Supreme Court tossed out in June, "this case does not involve cash or Rolexes from a stranger, but campaign contributions and hospitality from a long-time friend."

The Supreme Court will decide early next year whether to hear the case, after the Justice Department has responded to the Menendez filing.