Hunter Biden, President Biden’s troubled son and the target of long-running Republican efforts to cast the first family as corrupt, is expected to plead guilty on Wednesday in federal court to two misdemeanor tax charges and accept an agreement that will allow him to avoid prosecution on a gun charge.

If approved by a judge, the deal, reached by lawyers for the younger Mr. Biden with the U.S. attorney in Delaware, David C. Weiss, a Trump appointee who was kept on by the Biden Justice Department to complete the investigation, would result in no prison time.

The younger Biden’s appearance as a defendant in Federal District Court in Wilmington — the city where his father started his political career and the future headquarters of the Biden-Harris re-election campaign — will be a humbling homecoming and a reckoning of sorts for years of tawdry and ethically questionable behavior.

Republicans have assailed the plea deal as far too lenient. Citing the congressional testimony of two I.R.S. agents who were involved in the federal investigation, House Republicans have suggested that the Justice Department meddled in the case by failing to give Mr. Weiss the full authority over the investigation that it had promised him — an assertion that Mr. Weiss and Attorney General Merrick B. Garland have rebutted.

On Tuesday, House Republicans sought to intervene in the case, citing the testimony of the I.R.S. agents and suggesting that the judge reject the plea deal as tainted by politics.

Led by former President Donald J. Trump, Republicans have sought for years, with little success, to use Hunter Biden’s foreign business dealings and unseemly, drug-fueled events in his personal life to attack the elder Biden.

Attacking and investigating Hunter Biden has become a cottage industry on the right, fueling constant coverage in conservative news outlets, providing fodder for congressional inquiries and useful themes for Republican fund-raising and serving to fuel disdain among anti-Biden voters.

Mr. Trump’s first impeachment was triggered by his pressure campaign on Ukraine to help show potential wrongdoing by Hunter Biden connected to his work as a board member of a Ukrainian energy company. And for the past 18 months, House Republicans have put Hunter Biden at the heart of an investigation that they maintain will show that his father abused his power as vice president and president to enrich his family.

But no evidence has surfaced that President Biden took any substantive action to help his son or his son’s business partners, and the yearslong federal criminal investigation under Mr. Weiss has not implicated him. Mr. Weiss looked at a range of Hunter Biden’s activities, including his international business when his father was vice president and later when Hunter was addicted to crack cocaine, and pursued only the narrow tax and gun charges.

Among the issues prosecutors examined were Hunter Biden’s business deals with Chinese investors and his work as a member of the board of the Ukrainian energy company, Burisma, for which he was paid about $600,000 a year, when his father was vice president and overseeing the Obama administration’s policy toward Ukraine.

After lengthy negotiations between Mr. Biden’s lawyer, Christopher Clark, and Mr. Weiss, Mr. Biden agreed to plead guilty to misdemeanor counts of failing to pay his taxes on time for 2017 and 2018, a period in which Mr. Biden has admitted he was addicted to crack cocaine following the death of his brother, Beau.

In his statement released when the deal was first announced in June, Mr. Weiss said Mr. Biden had earned more than $1.5 million in each of 2017 and 2018, but failed to file income tax returns despite owing the government more than $100,000 each year. Mr. Biden paid the overdue tax bill in 2021.

Mr. Weiss’s office has also charged Mr. Biden in connection with the purchase of a handgun in 2018, when Mr. Biden falsely said on a government form that he was not using drugs. But as part of the deal, the Justice Department, under what is known as a pretrial diversion agreement, said it would not prosecute Mr. Biden on the charge as long as Mr. Biden no longer owns a weapon and remains drug free for two years.

The agreement between Mr. Weiss and Mr. Clark came after negotiations that were at times contentious and more akin to the interactions between the department and a major corporation facing a complex investigation than between prosecutors and a first-time offender who has repaid his back taxes.

After his father became vice president in 2009, Hunter Biden built relationships with wealthy foreigners that brought in millions of dollars, surfacing concerns inside the Obama administration and among government watchdog groups that he was cashing in on his family name.

As president, Mr. Trump, realizing that Mr. Biden was the candidate with the best chance to beat him in 2020, tried to weaponize Hunter Biden’s business dealings against his father. Mr. Trump’s longtime confidant Rudolph W. Giuliani was dispatched to Ukraine to dig up dirt on the Bidens, and Mr. Trump was impeached the first time for withholding military aid from Ukraine at the time he was pressuring the government there to say it was investigating Hunter Biden.

At the height of the 2020 election, Mr. Giuliani and other Trump confidants believed they had an October surprise that would catapult Mr. Trump to re-election when they obtained a cache of files from Hunter Biden’s laptop. While the laptop surfaced embarrassing disclosures about Hunter Biden when he was addicted to drugs — and raised legal and ethical questions about his business dealings — it did not demonstrate any wrongdoing by the elder Biden.