First son Hunter Biden is asking for federal gun charges he pleaded not guilty to earlier this week to be dismissed, claiming he has immunity against the indictment stemming from an earlier plea agreement with prosecutors.

Defense attorneys Abbe Lowell and Richard Jones said a July diversion agreement “that both parties signed remains in force, and he will seek to dismiss the Indictment against him pursuant to the immunity provisions of that Agreement,” according to a Friday court filing.

The attorneys argued the “only charge” special counsel David Weiss “was permitted to bring” as part of the diversion agreement were tax charges that have since been dismissed after the first son’s plea deal blew up in court.

“If the Special Counsel no longer wishes to pursue that charge, it has the right to do that,” Lowell and Jones wrote.

Weiss indicted Hunter Biden last month on three counts of making false statements about his drug use when purchasing a gun in 2018.

The first son faces up to 25 years in prison if convicted on all charges.

Hunter’s defense team accused federal prosecutors in August of having reneged on the original plea agreement, which they said remained “valid” and “binding” despite its spectacular implosion on July 26 in Delaware court.

Weiss’ team denied that Hunter’s agreement remained “in effect,” saying defense lawyers had “cobbled together snippets” from the hearing transcript to make their case and that neither the judge nor the probation officer had approved the deal.