Hunter Biden told a federal judge late Sunday that the Justice Department was trying to renege on a major part of his deal with the government — his agreement to enroll in a diversion program for gun offenders — that he signed and granted him broad immunity from future federal prosecutions.

The move, included in a court filing by his lawyer, Christopher Clark, is the latest exchange in an escalating dispute between Mr. Biden and David C. Weiss, the Trump-appointed U.S. attorney in Delaware who was appointed special counsel last week after the implosion of an agreement that would have spared the president’s son prison time.

It adds to the growing uncertainty over how the Biden investigation, which Republicans have made a central prong in their attacks on President Biden, will ultimately be resolved. The government, in recent filings, has said the yearslong inquiry, which seemed to be nearing an end last month, might be headed to a trial. Another of Hunter Biden’s lawyers, Abbe Lowell, suggested over the weekend that the agreement could somehow be revived.

Shortly after Attorney General Merrick B. Garland elevated Mr. Weiss to special counsel, government lawyers said in court papers on Friday that they and Mr. Biden were at an impasse over plea negotiations and that no agreement had been reached. Under the deal, Mr. Biden would plead guilty to two tax misdemeanors and enroll in the diversion program, which would have allowed him to avert prosecution on a gun charge.

But in the filing late Sunday, Mr. Biden rebutted the prosecutors’ claim, saying that he had signed the agreement in court last month and that he planned to abide by it.

Mr. Clark, in a three-page response to the government’s motion to scrap the entire deal, accused Mr. Weiss of deciding to “renege on the previously agreed-upon plea agreement.”

The part of the deal that included the gun diversion agreement — which included a broad grant of immunity from prosecution on any possible crimes that have been investigated, including the tax charges — had been signed by prosecutors and was therefore “binding” and still “in effect,” Mr. Clark wrote.

Wyn Hornbuckle, a spokesman for the special counsel, had no comment.

Judge Maryellen Noreika of Federal District Court, who has expressed serious reservations about the agreement, quickly ordered Mr. Weiss to respond to Mr. Biden’s filing by noon on Tuesday.

Judge Noreika is largely responsible for the unwinding of an agreement that Republicans have slammed as a “sweetheart deal” aimed at shielding the president’s troubled son from the consequences of not paying taxes on millions he earned representing companies in Ukraine and China.

The investigation appeared to be coming to a close in June, when both sides announced they had reached a deal. But during a hearing in Delaware last month, where the agreement was supposed to be finalized, Mr. Biden’s lawyers and Mr. Weiss’s prosecutors indicated drastically different views of a provision that offered Mr. Biden some level of immunity. The judge put the matter on hold, stunning the participants with her scouring skepticism, and she refused to green-light the deal until she received more information from both parties.

“You all are saying, ‘Just rubber-stamp the agreement,’” the judge said. “I’m not in a position to accept or reject it. I need to defer.”

In the weeks that followed, both sides tried to salvage the deal. Mr. Weiss, in court papers on Friday, raised the possibility that he would take Mr. Biden to trial on the tax charges.

Mr. Weiss has since 2018 investigated a wide array of accusations involving Mr. Biden’s business and personal life, including his foreign dealings, drug use and finances. But as special counsel, Mr. Weiss, who is also the U.S. attorney in Delaware, can pursue charges in any jurisdiction he chooses without seeking the cooperation of local federal prosecutors.

In an announcement on Friday, Mr. Garland said Mr. Weiss had concluded that the investigation reached a stage in which the powers of a special counsel were necessary. He did not explain what Mr. Weiss meant.

“The appointment of Mr. Weiss reinforces for the American people the department’s commitment to both independence and accountability in particularly sensitive matters,” Mr. Garland said. “I am confident that Mr. Weiss will carry out his responsibility in an evenhanded and urgent manner and in accordance with the highest traditions of this department.”

House Republicans have repeatedly attacked the plea deal since it was announced. They have highlighted the testimony of two I.R.S. investigators who worked on the case and said the inquiry was stymied and slow-walked by Justice Department officials during both the Trump and Biden presidencies.

On Monday, the House Oversight Committee released a transcript of a closed-door interview with an F.B.I. agent who worked on the case and who backed up portions of the I.R.S. investigators’ testimony. The agent said he had planned to try to interview Mr. Biden as part of the investigation, but higher-ups at the F.B.I. notified the Secret Service a day earlier than expected, and he was disallowed from even approaching the residence to attempt the interview.

However, the agent also vouched for Mr. Weiss’s integrity and testified that he had never observed Mr. Weiss to allow politics to affect his judgment.

“Have you ever known U.S. Attorney Weiss to make prosecutorial decisions based upon political influence?” the agent was asked.

“No,” he replied.