Democrats clashed with Attorney General William P. Barr on Tuesday at a congressional hearing marked by angry recriminations over racial justice protests in Portland, Ore., and around the country, as the nation’s top law enforcement official said additional agents were needed to subdue aggressive, violent crowds.

The hearing before the House Judiciary Committee was acrimonious from the outset, as liberal lawmakers accused the conservative attorney general of politicizing the Justice Department through his deployment of federal agents to U.S. cities, his involvement in high-profile prosecutions of people connected to President Trump, and his posture toward the upcoming presidential election.

Lawmakers spent months seeking Barr’s testimony on a host of issues related to the Trump administration’s interactions with the Justice Department. With the attorney general finally seated at the witness table, Democrats mostly made speeches or talked over him as he attempted to answer their questions, seemingly squandering any chance of getting new information or an admission out of him.

“This is a hearing; I thought I was the one who was supposed to be heard,” Barr said in exasperation.

In a thick fog of partisan bickering, indignant lawmakers argued about everything from mask-wearing etiquette to bathroom breaks. In the afternoon, the committee chairman, Rep. Jerrold Nadler (D-N.Y.) initially refused Barr’s request for a five-minute break. “You’re a class act,” the attorney general said sarcastically, before Nadler relented.

Many of the angriest exchanges focused on the federal government’s response to protests over police misconduct and brutality, with Nadler accusing the attorney general of deploying more manpower to spark ugly confrontations with protesters because, the lawmaker argued, Trump believes such confrontations will scare Americans into voting for him.

“You are projecting fear and violence nationwide in pursuit of obvious political objectives. Shame on you, Mr. Barr,” Nadler said.

Barr replied that U.S. marshals and other federal agents have a duty to guard Portland’s federal courthouse from people tossing fireworks and trying to vandalize and break into the building. He said they are under siege in that building and need help dealing with a nightly barrage of fireworks, fires, and attacks. Multiple law enforcement personnel have sustained serious injuries, Barr said.

“We are on the defense, we are not looking for trouble, and if the state and the city would provide the law enforcement services that other jurisdictions do, we would have no need to have additional marshals in the courthouse,” the attorney general said.

The Washington Post reported Monday that law enforcement officials have decided to send 100 deputy marshals to Portland to beef up courthouse security; Customs and Border Protection is sending an additional 50 agents. The first new batch of deputy marshals, according to internal emails reviewed by The Post, were dispatched to Portland last week.

State and local officials have called for federal agents to leave the city, a demand rejected by the Department of Homeland Security and the Justice Department.

Republicans and Democrats played dueling videos at the hearing about the protests. The Republicans’ video showed police officers and federal agents under siege, being hit with projectiles, and rioters stomping on top of police cars. The Democrats’ video showed peaceful protesters singing and chanting for the Black Lives Matter movement.

Barr argued that force was needed to repel rioters, not protesters, arguing, “when people resist law enforcement, they’re not peaceful.”

Rep. Ken Buck (R-Colo.) suggested Barr use a complex anti-racketeering law known as RICO to go after those committing acts of violence at the protests.

“General Barr, this has to stop. We can’t let antifa continue terrorizing our country,” said Buck, referring to the far-left anti-fascist movement demonized by Trump. RICO is a complex, decades-old law designed to dismantle criminal organizations, though it is rarely used because it is often simpler for federal prosecutors to charge suspects with conspiracy or other crimes. RICO was most famously used in the 1980s to prosecute the leaders of New York’s Mafia families.

Barr told the congressman he had assigned counterterrorism investigators to help investigate what he called “violent extremist terrorists who are involved in these activities, and one of the tools obviously we would use is RICO, which could be used against an organization,” though he quickly added, “That doesn’t mean that we currently have a RICO case pending.”

Rep. Pramila Jayapal (D-Wash.) accused Barr and those in the GOP from seeking to distract from what the protests were actually about — the “persistent killing of black bodies by law enforcement.”

She took particular aim at the move by federal police to clear demonstrators around Lafayette Square near the White House in early June, just before the president walked across the area to pose for a photo at a nearby church, and contrasted the episode with how Trump supported other demonstrators, such as those in Michigan protesting coronavirus-related shutdown measures.

“Apparently the president believes that you can be activated to implement the president’s agenda and dominate American people exercising First Amendment rights if they’re protesting against him,” Jayapal told Barr.

Jayapal asked Barr if he was aware the Michigan protesters had called for the state’s governor, Gretchen Whitmer (D), to be “lynched, shot and beheaded?” Barr said he was not. As Jayapal expressed her dismay, Barr began to argue that there are “a lot of protests” in the U.S. and he was focused on those that threaten federal property.

Barr was equally defensive of his interventions of high-profile criminal cases involving allies of the president — most notably Trump’s longtime friend Roger Stone and former national security adviser Michael Flynn. Democrats accused the attorney general of using the Justice Department to shield Trump and his friends while prosecuting his enemies.

“The message these actions send is clear: In this Justice Department, the President’s enemies will be punished and his friends will be protected, no matter the cost, no matter the cost to liberty, no matter the cost to justice,” Nadler said.

Barr insisted that was not true, saying Trump “told me from the start that he expects me to exercise my independent judgment to make whatever call I think is right,” adding, “That is precisely what I have done.” He challenged his critics to point to a single indictment of one of Trump’s foes.

“I’m supposedly punishing the president’s enemies and helping his friends,” Barr said. “What enemies have I indicted? Who — could you point to one indictment that has been under the department that you feel is unmerited?”

Flynn pleaded guilty in 2017 to lying to the FBI about his conversations with a Russian diplomat during the presidential transition, though he later hired a new legal team and fought the case. As Flynn awaited sentencing, Barr tapped the U.S. attorney in St. Louis to review how the case was handled and ultimately had the Justice Department move to throw it out. The matter is now tied up in an appeals court, after a federal judge balked at the Justice Department’s request.

Stone was convicted last year of lying to Congress as it investigated Russian interference in the 2016 election. As he awaited a hearing on his penalty, Barr moved to override career prosecutors sentencing recommendation in the case. The career prosecutors wanted a term of seven to nine years; Barr pushed for something lesser.

Barr insisted in both instances that his interventions were of his own volition, and not because of Stone and Flynn’s relationships with Trump. He took special aim at the career prosecutors, characterizing their recommendation as overly harsh and out of step with what a judge ultimately imposed.

“This is a 67-year-old man, first-time offender, no violence, and they were trying to put him in jail for seven to nine years,” Barr said of Stone. “And I wasn’t going to advocate that, because that is not the rule of law.”

“The judge agreed with me,” he stressed later.

While it is true a judge ultimately sentenced Stone to 40 months in prison, she did so only after calling Barr’s intervention “unprecedented.” Moreover, career prosecutors’ dispute with Barr was over a technical point: They wanted to recommend a sentence within what federal guidelines called for, which Justice Department prosecutors almost always do, while Barr felt some leeway was in order.

“The president’s friends don’t deserve special breaks, but they also don’t deserve to be treated more harshly than other people,” Barr said Tuesday.

In a similar vein, Barr said that, as it was happening, he was unaware of authorities’ move to send Trump’s former attorney, Michael Cohen, back to prison after his release as part of an initiative meant to stem the spread of coronavirus in prisons. Barr said the decision was mostly due to demands of the U.S. Probation and Pretrial Services System, which is part of the federal court system, not his department.

Several Democrats sought to press Barr on the 2020 election — particularly whether foreigners were seeking to interfere with it, why he believes mail-in voting would lead to fraud and whether he will ultimately accept the result should Trump lose.

Perhaps the most notable exchange came when Rep. Cedric L. Richmond (D-La.) asked if he believed the election would be “rigged.” In an interview this month, Trump told Fox News that he believes “mail-in voting is going to rig the election” and declined to say whether he will accept the November results.

“I have no reason to think it will be,” Barr said.

Barr, however, stood by his repeated public suggestion that mail-in voting could lead to fraud, particularly if the practice is expanded to be used en masse. Some of his critics have said there is no evidence to support that assertion, and Barr himself conceded he has voted by mail at least once.

Barr said Americans “have to assume” Russia is seeking to interfere in the coming election, though he offered no specifics. In one exchange, he stumbled when asked whether it would be appropriate for the president “to solicit or accept foreign assistance in an election.” At first, Barr told Rep. David N. Cicilline (D-R.I.) “it depends what kind of assistance.” But when asked the question again, with Cicilline adding that the assistance could be “of any kind,” Barr shifted course.

“No, it’s not appropriate,” he said.

Unlike Trump, Barr did confirm he would leave office if Trump lost.

“If the results are clear, I will leave office,” Barr said.

John Wagner and Nick Miroff contributed to this report.