WASHINGTON (CN) — Attorney General William Barr on Tuesday defended the Trump administration’s use of federal agents to respond to racial justice protests, as Democrats accused him of seeking conflict in the streets and using the Justice Department to aid the president’s re-election bid.

Appearing before the House Judiciary Committee, Barr said federal authorities that have violently clashed with protesters in cities like Portland, Oregon, have merely been protecting federal property under attack from a small group of people taking advantage of otherwise peaceful protests to do violence.

The scenes out of Portland amid ongoing protests for racial justice spurred by the death of George Floyd while in Minneapolis police custody have captured stark images of conflicts between protesters and law enforcement, including federal agents who have fired tear gas into crowds.

Videos have shown federal agents, some of whom were not wearing identifying information, beating and using pepper spray on protesters and arresting demonstrators, sometimes from unmarked vehicles and without providing a reason.

The response from federal agents has spawned waves of lawsuits and concerns from civil liberties groups. Democrats on Tuesday suggested the deployment is meant to heighten tensions in an election year with the aim of stirring up the president’s base and aid his re-election chances.

Representative Steve Cohen, who has introduced a resolution to launch an impeachment inquiry against Barr, said federal agents have gone too far in their actions against protesters in cities across the country, threatening important constitutional principles and norms.

“In Portland we’ve seen mothers and we’ve seen veterans who were peacefully protesting, not threatening the federal courthouse, beaten and gassed,” Cohen said. “Unidentified armed federal agents violently attack demonstrators in a violation of the First Amendment’s freedom of assembly and arrested citizens without individualized suspicion in violation of the Fourth Amendment’s protection against unreasonable searches and seizures and warrant requirement. You’ve gone through the Fifth Amendment and due process and just negated it.”

Defending the federal agents, Barr said that alongside peaceful protests, some people have set fires outside the Portland courthouse that has become a flashpoint in the conflict, launched fireworks at the building and flashed laser pointers and thrown projectiles at the officers inside.

He told Representative Jim Jordan that he does not believe the courthouse would be standing today without the federal agents.

“The U.S. marshals have a duty to stop that and defend the courthouse and that’s what we are doing in Portland,” Barr said Tuesday. “We are at the courthouse defending the courthouse. We’re not out looking for trouble.”

The incidents in Portland come amid larger concerns about how the Trump administration has responded to protests following Floyd’s death. Democrats also pressed Barr on the controversial clearing of Lafayette Square outside the White House on June 1, ahead President Donald Trump’s photo opportunity outside the historic St. John’s Episcopal Church.

Barr told the committee the use of tear gas on a group of mostly peaceful protesters was meant to push the perimeter back a block so authorities could set up fencing around the square, which is across the street from the White House and is the site of frequent protests. Barr said that the decision to move the perimeter was reached the night before, when some demonstrators set a fire in the church.

In the face of Barr’s defense of the federal response to protests, Representative Pramila Jayapal accused Barr of inconsistency. She noted the Justice Department did not appear concerned when armed demonstrators, including some white supremacists, entered the Michigan statehouse in protest of the state’s actions to limit the spread of Covid-19.

“You take an aggressive approach to Black Lives Matter protests, but not to right-wing extremists threatening to lynch a governor if it’s for the president’s benefit,” Jayapal said.

Tuesday presented the first chance for Democrats on the House Judiciary Committee to question Barr after months of controversy over the attorney general’s handling of high-profile prosecutions and allegations that he has politicized the agency he leads.

“In your time in the department, you have aided and abetted the worst failings of the president,” Representative Jerry Nadler, a New York Democrat who chairs the committee, said Tuesday.

As chief examples of those concerns, Democrats have pointed to the Justice Department’s handling of prosecutions of Michael Flynn and Roger Stone and Barr’s interest in the origins of the investigation into allegations of coordination between Russia and the Trump administration during the 2016 election.

Barr has ordered multiple reviews of the origins of the FBI’s Russia investigation, sparking claims from Democrats that he is leveraging the department’s investigatory powers to discredit the probe that has been the frequent target of Trump’s ire.

When asked on Tuesday, Barr would not commit to keeping the results of the primary review, which is being led by Connecticut U.S. Attorney John Durham, under wraps until after the 2020 election.

The controversy over Stone began in February, when the Justice Department walked back its initial recommendation that the longtime Trump confidante spend between seven and nine years in prison for lying to Congress about his communications with WikiLeaks during the 2016 election.

A new sentencing memo, filed after Trump publicly blasted the initial recommendation as a “miscarriage of justice,” asked for a significantly lighter sentence for Stone and prompted resignations from the career prosecutors who worked on the case. U.S. District Judge Amy Berman Jackson eventually sentenced Stone to 40 months in prison and Trump commuted the sentence earlier this month.

Barr denied Trump’s tweet had any impact on the sentencing recommendation, saying he never discussed the issue with anyone in the White House. He said he made the decision to issue a new memo before the president weighed in on Twitter because the initial recommendation was too harsh, even though it fell within the sentencing guidelines.

“It was within the guidelines, but it was not within Justice Department policy in my view,” Barr said.

He said he hesitated at first to go forward with the new memo because he was concerned about the political backlash and repeatedly mentioned Stone’s advanced age and lack of prior criminal history as justifying a lower sentence.

Aaron Zelinsky, who served on the team that prosecuted Stone, told the Judiciary Committee last month that Stone was given “unheard of” breaks during his prosecution because of his political ties.

The Justice Department dropped the prosecution of Flynn, who pleaded guilty to lying to the FBI about his conversations with the Russian ambassador during the transition, in May after determining there was no valid basis to conduct the interview in which he lied to investigators. Flynn, Trump’s former national security adviser, has sought to withdraw his guilty plea, claiming he was set up and tricked into lying by federal agents.

Trump has been vocal in his criticisms of the prosecution, saying Flynn was treated unfairly and calling the prosecution a politically motivated attempt to harm the administration. The Justice Department and Flynn are currently fighting in court to force the federal judge handling Flynn’s case to drop the charge.

Barr dismissed allegations from Democrats that the decision was politically motivated and insisted Trump has not interfered in any criminal matter during his time at the Justice Department.

“He has never asked me, directed me, pressured me to do anything in a criminal case,” Barr said.

The all-day hearing, which started 45 minutes late because Nadler was in a minor car accident, was often contentious, with Barr interrupting members and expressing frustration that Democrats did not give him a chance to respond to some of their questions.

“You said under penalty of perjury, I want to answer the damn question,” Barr said in response to a question from Representative Joe Neguse.