A last-ditch attempt by Democratic senator Bob Menendez (N.J.) to avoid a federal corruption trial slated to start next month was rejected by a federal judge on Wednesday.

Menendez, accused of giving political favors to Florida eye doctor Salomon Melgen in exchange for campaign contributions and gifts, asked that the case against him be dismissed on account of the Supreme Court's 2016 decision to overturn the corruption conviction of former Virginia governor Bob McDonnell (R.).

Menendez's attorneys argued that none of the alleged assistance he offered Melgen were "official acts," and therefore, based on the Supreme Court's McDonnell decision, the legal argument against him was invalid.

U.S. District Court Judge William Walls said the determination of whether Menendez performed an "official act" in his attempts to benefit Melgen will be made during the trial, which is set to begin on Sept. 6.

"Whether the acts alleged in the Superseding Indictment satisfy the definition of an ‘official act’ under McDonnell is a factual determination that cannot be resolved before the Government has the opportunity to present evidence at trial," wrote Walls in his rejection of the dismissal request.

Menendez received campaign contributions from Melgen, in addition to flights on private jets and luxury vacations.

Prosecutors allege Menendez asked government officials to assist Melgen in his billings dispute with the Center for Medicare and Medicaid Services. Melgen was found guilty in April of Medicare fraud.

Menendez will be busy with court proceedings for four days a week beginning in September. Jury selection for the trial will begin later this month.

Polling has found that a majority of New Jersey voters think Menendez should have resigned shortly after the corruption charges were brought against him.

The indictment against Menendez also includes allegations that the senator assisted Melgen with visa applications for three of his girlfriends and colorful explanations of the trips that were gifted by Melgen, including a $5,000 stay in Paris for Menendez and his girlfriend.

Menendez and committees tied to him received over $750,000 in contributions from Melgen.