The leaders of the Justice and Homeland Security departments stressed the threat posed by domestic violent extremists, particularly white supremacists, at a Senate Appropriations Committee hearing Wednesday punctuated by political infighting about the growing problem.

Attorney General Merrick Garland and Homeland Security Secretary Alejandro Mayorkas said their agencies are dedicating more resources to the government’s fight against domestic terrorism, creating new intelligence initiatives, and working with foreign partners and tech companies to help stem the growing threat.

Each testified that white supremacist extremists represent the most persistent and lethal threat, and Garland said he is acutely concerned with responding to the Jan. 6 attack on the U.S. Capitol, in which supporters of then-President Donald Trump, upset about the election result, assaulted police officers and stormed the building in a failed bid to stop Congress from certifying the electoral college’s results.

Republicans, meanwhile, sought to highlight violent unrest associated with last summer’s racial justice protests, some of which they attributed to adherents of a far-left anti-fascist ideology.

The hearing reinforced the challenge of addressing domestic violent extremism not just because of concerns about civil liberties, but because of rancorous partisan divides.

Garland said the Justice Department’s role is to “investigate and prosecute violations of the criminal law regardless of ideology,” seeming to try to bridge the partisan gap. But he said he has “not seen a more dangerous threat to democracy than the invasion of the Capitol.”

“There was an attempt to interfere with the fundamental passing element of our democracy, the peaceful transfer of power,” he said. “And if there has to be a hierarchy of things that we prioritize, this would be the one we prioritize because it is the most dangerous threat to our democracy.”

The political squabbling was foreshadowed early in the hearing. In his opening remarks, Sen. Patrick J. Leahy (D-Vt.), the committee chairman, took aim at Trump, suggesting that his rhetoric had exacerbated the problem of domestic extremism.

Leahy noted that, in 2017, after a woman was killed by a white supremacist while she protested at a rally of alt-right groups in Charlottesville, Trump said there were “very fine people on both sides.” Trump, he said, also declined to condemn white supremacists and armed militia members during a presidential debate in 2020, and at a rally before many of his supporters stormed the Capitol on Jan. 6, Trump told them they needed to “fight like hell.”

“You can’t strike a match near gas and then act surprised when it catches fire,” Leahy said.

Sen. Richard C. Shelby (R-Ala.) countered that Democrats “would have the American people believe that all domestic, violent extremists are far right white supremacists and that all Republicans are complicit in their actions.”

“Of course, both are false,” he said, noting the sometimes violent unrest associated with racial justice protests over the summer and the far-left antifa ideology.

Garland and Mayorkas sought to stay above the fray, stressing their departments’ work on the broad threat of domestic extremism and avoiding tense confrontations.

The Justice Department, Garland said in written remarks, is “deepening collaboration” with foreign countries to explore possible links between domestic violent extremists and their counterparts abroad, as well as sharing information with tech companies “to help them address the spread of domestic violent extremist activity online.”

“I can’t give a sense of the magnitude of the problem, but I do think that we have to worry about interactions between domestic violent extremists, particularly racially motivated and ethnically motivated ones, where there are similar groups, particularly in Europe, with similar ideological bents,” Garland said.

Mayorkas, meanwhile, said he had designated domestic violent extremism a “national priority area” with the department’s grant program, and recently established a “domestic terrorism branch” within the Department of Homeland Security’s Office of Intelligence and Analysis. He said that the department had also started an internal review to identify possible extremists in its own ranks, and that it is committed to making the results of that review public.

As Garland and Mayorkas testified, the House Committee on Oversight and Reform simultaneously questioned Trump administration officials and others about the Capitol riot, particularly how they prepared and what they did as the complex was being attacked. Garland told lawmakers at the Senate hearing that the Justice Department has arrested more than 430 people in that investigation.

Garland and Mayorkas pointed to their agencies’ well-known work on domestic terrorism, while also highlighting more-nuanced steps that might have escaped public notice.

The Justice Department’s Office of Community Oriented Policing Services, for example, is making hate crimes and domestic extremism an “area of special consideration” as it doles out grants, Garland said in written remarks. Its National Institute of Justice is funding research that examines the radicalization process and reintegrating those imprisoned for terrorism-related offenses, he added, and the Bureau of Prisons is reviewing its risk-assessment tools in recognition of the “evolving nature” of extremist ideologies that sometimes spread behind its walls.

Garland previously has promised to make fighting domestic terrorism a top priority. In a hearing last week — his first as attorney general — he asked lawmakers on a House Appropriations subcommittee to support his department’s request for a $45 million increase in funding for the FBI for domestic terrorism investigations and a $40 million increase for U.S. attorneys to manage the ensuing caseloads. In his testimony to the Senate Appropriations Committee, he noted in written remarks that President Biden’s budget request for fiscal 2022 seeks more than $100 million in additional funding to address the rising threat of domestic violent extremism when other Justice Department components are included.

As he often does, Garland pointed to the 1995 bombing of the Alfred P. Murrah Federal Building in Oklahoma City that killed 168 people in one of the deadliest domestic terrorist attacks in U.S. history. Garland supervised prosecutors who worked on that case. He also highlighted the department’s work pursuing white supremacists early after its founding and its current focus on hate crimes, while being careful to note that hateful ideologies by themselves are not criminal.

“In all our efforts to combat these domestic threats, the Justice Department is guided by our commitment to protecting civil liberties” Garland said. “In our country, espousing an extremist ideology is not a crime. Nor is expressing hateful views or associating with hateful groups.”

Garland noted that the department recently issued guidance to all federal prosecutors imposing new requirements for identifying and tracking prosecutions involving domestic violent extremism, and it also has been working with the Department of Homeland Security and the intelligence community in a broad review of the government’s response to domestic violent extremism.

Hannah Allam contributed to this report.