Lawyers for Sen. Robert Menendez accused federal prosecutors and FBI agents Monday of lying to win a corruption indictment against him this spring, saying the Justice Department would “stop at nothing” to try to convict the powerful lawmaker.

The allegations are included in more than 400 pages of legal arguments filed to try to persuade the court to dismiss the case against Menendez (D-N.J.) and a longtime friend and donor, Florida eye doctor Salomon Melgen, who is accused of buying favors from the senator with gifts and vacations.

The joint filings by lawyers for the two men demonstrate the aggressive legal strategy that Menendez, 61, has adopted as he readies for the fight of his life to save an enduring career that helped him rise from a childhood in a tenement apartment as a son of Cuban immigrants to become one of the country’s most influential senators. He is backed by a legal defense fund that has raised $3 million, largely from wealthy pro-Israel advocates who see the hawkish former Senate Foreign Relations Committee chairman as a key ally in opposing a nuclear deal with Iran.

The filings point to a possible contradiction that threatens to undermine a central allegation against Menendez — that he personally lobbied top officials in the Department of Health and Human Services to help Melgen, who was under investigation for allegedly overbilling Medicare.

According to the defense documents, the lead prosecutor allowed an FBI agent to falsely testify to the grand jury that HHS officials were “perfectly clear” that Menendez had been seeking favorable treatment for his friend. In contrast, defense lawyers argued, internal FBI memos showed the officials saying that they couldn’t recall Menendez mentioning Melgen, and one said she wasn’t sure what Menendez specifically wanted.

In attacking the credibility of the Justice Department, Menendez and his lawyers are making claims that recall the prosecutorial mistakes that forced the government in 2009 to withdraw a corruption conviction against another senior senator, Ted Stevens (R-Alaska). That case remains a black eye for the department’s public integrity division, which is heading the Menendez prosecution.

A Justice Department spokesman said Monday that the government will review the filings and respond with its own filing next month.

“Generally, the government likes to speak through the court and not through the press,” spokesman Peter Carr said. “We will file a response at the appropriate time with the court.”

Federal investigators launched their probe of Menendez in 2012 based on what turned out to be a fabricated claim that he patronized underage prostitutes when visiting Melgen at his Dominican Republic resort home. The investigation morphed into a broader look at the relationship between the two men and whether Menendez was using his power in Washington to help Melgen’s business interests.

The 14-count indictment, handed down in April, accused Menendez of using the influence of his office to advance Melgen’s financial interests in exchange for luxury gifts, lavish vacations and more than $750,000 in campaign donations.

Prosecutors charged that Menendez twice intervened on the doctor’s behalf, first with federal regulators over the Medicare charges and also when Melgen sought to secure a ­port-security contract in the Dominican Republic, according to the indictment.

Monday’s filings provided a behind-the-scenes look at the three-year-old investigation.

Investigators, for instance, were intensely focused on the sex lives of Menendez and Melgen. The documents show that investigators called more than a dozen women who had had personal relationships with the men in the past decade and asked them for details. They asked women who dated Melgen about how frequently they had sex with him and when they “became intimate” with him. In one session, a federal prosecutor asked a senior Menendez aide, who had worked for 15 years on his staff, if she had ever had sex with the senator, the filings show.

The senator’s legal team argued that the Justice Department ignored a constitutional protection that bars criminal prosecution of members of Congress for doing their official jobs as legislators.

Perhaps the most dramatic claim was the allegation that the top prosecutor on the Menendez case, Peter Koski, presented false testimony from an FBI agent to the grand jury hearing the case.

In this instance, the agent was describing what then-HHS Secretary Kathleen Sebelius and another top administration official said about two separate meetings they had with Menendez, in which the senator raised questions about a billing policy that had led to the department accusing Melgen of overbilling the government by millions of dollars, according to the defense filings.

Under questioning from Koski before the grand jury, the FBI agent said Sebelius and Medicare chief Marilyn Tavenner both knew that Menendez’s purpose in the meetings was to advocate for Melgen, according to the filings from Menendez’s lawyers.

“Was it also clear that the meeting was about Dr. Melgen?” Koski asked the FBI agent, Gregory Sheehy, according to a grand jury transcript included in the defense filings.

Sheehy responded: “Perfectly clear. . . . It was all about Dr. Melgen, the meeting.”

But the defense contends that the agent’s description to the grand jury directly contradicted what the officials had told the FBI.

Excerpts of internal FBI memos summarizing agents’ interviews with Tavenner and Sebelius suggest that there was no such clarity, the filings say.

“Tavenner said they did ‘not specifically discuss Melgen’ and she at least twice noted that she could not remember if his name even came up,” according to an excerpt of an FBI memo cited by the defense.

Sebelius “said she could not recall whether MELGEN’s name specifically came up during the meeting,” another memo said. She “could not recall what MENENDEZ specifically wanted.”