Sen. Robert Menendez speaks at a press conference on March 6, 2015 in Newark New Jersey. Menendez is expected to face Federal corruption charges for allegedly using his office for the benefit of donors. (Kena Betancur/Getty Images)

If federal prosecutors pursue corruption charges against Sen. Robert Menendez, they will face a difficult — but not impossible — task in making their case.

Members of Congress accused of trading their official actions for personal gifts or campaign donations, as prosecutors are suggesting Menendez (D-N.J.) may have done, can rely on several legal defenses to stave off a conviction, experts say.

A federal official said Friday that charges are expected to be filed against Menendez, whose relationship with donor Salomon Melgen has been under scrutiny for more than two years.

Remarks that Menendez made Friday, after news outlets reported on impending criminal charges, suggest he is staking out just such a defense.

In denying wrongdoing, Menendez took pains to explain his longstanding relationship with Melgen, an ophthalmologist who owns eye clinics in South Florida.

“Everyone knows he and his family, and me and my family, have been real friends for more than two decades,” Menendez said in a statement. “We celebrate holidays together, have been there for family weddings and funerals, and have given each other birthday, holiday, and wedding presents — just as friends do.”

To convict Menendez under relevant federal corruption laws, prosecutors would be tasked with proving that Menendez acted knowingly in return for personal gifts — such as flights on Melgen’s private jet and visits to his resort home in the Dominican Republic. Melgen donated $700,000 to a super PAC supporting Menendez and other Democratic senators in 2012, as Menendez was campaigning for a second full term in the Senate.

“When there’s lengthy friendship, that quid pro quo aspect dissipates,” said Michael L. Koenig, a former Justice Department prosecutor now in private practice as a white-collar criminal defender.

Prosecutors appear to be trained on two instances when Menendez intervened on Melgen’s behalf, according to a Feb. 27 court decision from a federal appeals court in New Jersey.

In one, Menendez is said to have advocated for Melgen in 2012 discussions with high-level executive-branch officials, including then-Secretary for Health and Human Services Kathleen Sebelius, regarding a Medicare billing dispute. In the other, Menendez is said to have pressed U.S. Customs and Border Protection to favor a Melgen-owned company under contract to provide screening equipment for Dominican ports.

A lawyer for Menendez, Abbe D. Lowell, did not return a message seeking comment on his possible defenses.

The case against Menendez has some elements in common with the federal prosecution of former Virginia governor Robert F. McDonnell (R), who was convicted in September on multiple corruption charges for taking official actions on behalf of a businessman who had provided a stream of gifts to him and his family.

Menendez’s comments Friday, calling Melgen a bona-fide friend, could be seen as part of an effort to undermine the case that he acted as a result of any personal gifts or campaign contributions.

“Was he doing things on behalf of Dr. Melgen because he was receiving campaign contributions?” said Richard Briffault, a Columbia Law School professor who works in the area of public corruption. “Or was he doing it because he likes Dr. Melgen, which is not criminal?”

The businessman in the McDonnell case, Jonnie R. Williams Sr., was granted immunity and testified against the former governor at trial. It is unknown whether Melgen is cooperating with the prosecutors investigating Menendez.

Complicating the matter for Menendez is that he admitted to not disclosing expensive flights taken on Melgen’s jet in 2010, writing a $58,500 check in early 2013 to reimburse the Florida doctor for the expenses.

Menendez explained the lapse as an oversight and did not seek to report the flights as gifts from a personal friend, as is allowed under Senate rules with a waiver from the body’s Ethics Committee.

Prosecutors could seek to charge Menendez for “knowingly and willfully” filing false disclosure forms, but establishing criminal intent in that case could be difficult.

Michael Stern, a former senior counsel to the House of Representatives and former Senate investigator, said the lack of timely disclosure could help prosecutors make a larger case.

“If he didn’t disclose them properly, that adds to the inference that he had something to hide,” said Stern, who writes a blog about congressional legal issues.

Another obstacle that Menendez’s lawyers have already throw up in front of prosecutors is the Speech or Debate Clause, the constitutional provision that gives lawmakers immunity from prosecution for legislative acts.

The Feb. 27 appeals court decision, which was mistakenly unsealed, indicates that two Menendez aides cited the clause in refusing to testify before a grand jury investigating the case. A lower court ruled the aides must testify, finding that their interactions with Melgen did not constitute legislative acts. But the appeals court overturned that ruling, finding that the lower court must do more fact-finding before making any determination.

Both Stern and Nelson Lund, a constitutional law professor at George Mason University, said it is unlikely that Menendez could mount a throughgoing defense under the provision.

“The Speech or Debate Clause does not immunize you from bribery charges, but the kinds of evidence that the government may acquire or use can be affected,” Lund said.

For instance, Menendez advocated for Melgen’s security company indirectly during a committee hearing. That evidence, Briffault said, could be excluded, harming the Justice Department’s case.

Koenig, the former Justice attorney, said that if prosecutors file charges, they will be prepared for a tough battle — as is common in public corruption cases: “You’ve got well-funded defendants who will not be rolled by the government, who believe they’ve done nothing wrong. . . . So they will fight to the very end.”

Philip Bump and Paul Kane contributed to this report.