WASHINGTON — Two congressional committees on Wednesday voted to formally recommend that the full House hold Hunter Biden in contempt of Congress for defying a subpoena in the Republican impeachment inquiry into his father.

In separate votes, both GOP-led panels voted along party lines, in favor of advancing the resolution. The Judiciary Committee went first and voted 23 to 14, followed by the Oversight Committee 25-21 vote.

The votes came hours after the president’s son made a surprise visit to attend the committee meetings in person. He was accompanied by his attorneys Abbe Lowell and Kevin Morris.

Biden is at odds with GOP lawmakers over their demand that he be deposed behind closed doors.

The president’s son, facing two separate indictments, has said he would testify publicly, an offer Republicans have refused, continuing to insist that the interview be held privately.

During the Oversight Committee’s markup Wednesday morning, Rep. Nancy Mace, R-S.C., called for Biden’s arrest on the spot for defying the congressional subpoena.

“Hunter Biden, you are too afraid for a deposition, and I still think you are today,” she said.

“Play stupid games, win stupid prizes,” she added.

Biden and his legal team left shortly before Rep. Marjorie Taylor Greene, R-Ga., delivered remarks at the Oversight hearing in which she called Biden a “coward.”

Outside the chamber, Lowell said committee Republicans were motivated by “improper partisan motives.” He said he and his client had offered to work with Republicans on the committees on a half dozen occasions since last February, including on Wednesday, to see “how relevant information to any legitimate inquiry could be provided,” but their offers were ignored. He called a GOP subpoena in November for a closed-door deposition “a tactic that the Republicans have repeatedly misused in their political crusade to selectively leak and mischaracterize what witnesses have said.”

“The Republican chairs today then are commandeering an unprecedented resolution to hold someone in contempt who has offered to publicly answer all their proper questions,” Lowell added. “The question there is, what are they afraid of?”

Asked by NBC News shortly after leaving the Oversight hearing whether he would testify Wednesday if asked, Biden replied, “Yes.” He and his team then left the building.

During the Judiciary Committee’s contempt markup, Rep. Eric Swalwell, D-Calif., mentioned Biden’s unexpected appearance on Capitol Hill before moving to adjourn the meeting in order to have the president’s son testify in public given his presence down the hall at the time. The motion failed in a roll-call vote.

Biden did not attend the Judiciary panel’s meeting.

During his leadership news conference Wednesday, House Speaker Mike Johnson, R-La., said he was aware of Biden’s surprise appearance and called for “accountability” in response to his defiance of “a lawful” congressional subpoena.

“So I support the Oversight and Judiciary Committee efforts to hold him in contempt,” he told reporters. “We have to do this. This is our role. It’s our responsibility. We’re not taking any pleasure in this, this is not political.”

The committees’ votes, held a day before Biden is due to plead not guilty at his first appearance in court on tax charges in Los Angeles, are the latest in an escalating back and forth between the president’s son and House Republicans. In correspondence with the Republican-led House Oversight Committee in the fall and in a news conference in front of the Capitol last month on the day he was compelled to be interviewed, Biden said he would comply with the subpoena but only in public testimony, citing both the Judiciary and Oversight chairmen’s own previous comments that it could take place in public.

Biden and his attorneys have maintained that House Republicans’ claims of illegal conduct are baseless and have argued that they will selectively leak or mischaracterize his comments for partisan purposes if it takes place during a closed-door deposition. Oversight Committee Chairman James Comer, R-Ky., and Judiciary Committee Chairman Jim Jordan, R-Ohio, have said Biden must first testify behind closed doors, and in a report released Monday stated that “Mr. Biden’s flagrant defiance of the Committees’ deposition subpoenas — while choosing to appear nearby on the Capitol grounds to read a prepared statement on the same matters — is contemptuous, and he must be held accountable for his unlawful actions.”

The top House Democrat on the Oversight Committee, Rep. Jamie Raskin of Maryland, previously said in a statement “there is no precedent” for the House to hold a private citizen in contempt of Congress who has offered to testify under oath publicly and on a day chosen by the committee.

In 2021, when Democrats controlled the House, Trump administration officials Steve Bannon and Mark Meadows were held in contempt of Congress for defying subpoenas issued by the House Jan. 6 committee.

While the Justice Department in 2022 declined to prosecute Meadows, who was former President Donald Trump’s White House chief of staff, the case against Bannon, a former Trump adviser, led to a trial where a jury convicting him on two counts of contempt of Congress. He was sentenced to four months in prison and recently sought to overturn his conviction.

Biden’s attorney Lowell previously told NBC News in a statement: “It’s clear the Republican Chairmen aren’t interested in getting the facts or they would allow Hunter to testify publicly.

“Instead, House Republicans continue to play politics by seeking an unprecedented contempt motion against someone who has from the first request offered to answer all their proper questions. What are they afraid of?”

As part of the impeachment effort, Comer and Jordan asked the White House last month to provide any communications it has had with Hunter Biden’s legal team, telling White House counsel Edward Siskel that they seek to determine whether the president had a role in his son’s decision to defy their subpoena.

Sarah Fitzpatrick reported from Washington, and Summer Concepcion and Zoë Richards from New York.