The Menendez team asserts that the senator and the doctor have been close friends for more than 20 years, and that Dr. Melgen’s generosity was simply his way of sharing his wealth with a close friend.

But the prosecution argues that they were part of a corrupt pact to trade favors for influence. And, in a brief filed in court on Wednesday, prosecutors argued that even in a friendship, defendants could be found guilty of corruption.

“With respect to claims of friendship in particular, it is not uncommon for defendants to establish some evidence of friendship in bribery cases but still be found guilty,” the brief stated.

The prosecution will also attempt to show that the timing of Dr. Melgen’s gifts corresponded with Mr. Menendez’s actions on his behalf, and that pattern established the quid pro quo necessary for a bribery conviction.

In their brief, prosecutors alleged that Mr. Menendez began taking bribes from Dr. Melgen shortly after Mr. Menendez was elected to the Senate in 2006 and that a lot of his efforts on behalf of Mr. Melgen came after large donations to his re-election efforts and legal defense funds.

When Dr. Melgen needed help to resolve a contract dispute for a company he owned operating X-ray equipment in the Dominican Republic, he donated $60,000 to various political groups and super PACs supporting Mr. Menendez, the brief stated. On the same day, Mr. Menendez met with an assistant secretary on the state to press the issue, according to the brief.

When Dr. Melgen needed quick changes to a Medicare reimbursement program, he donated $300,000 through his company to Majority PAC, a super PAC supporting Democratic candidates for Senate. The same day, Mr. Menendez met with officials at Centers for Medicare and Medicaid Services, and a month later, with Kathleen Sebelius, then the secretary of Health and Human Services, according to the brief.