FBI Director Christopher A. Wray told senators Thursday that the United States has not experienced large-scale voter fraud by mail or other means, and said it would be a “major challenge” for a foreign country to attempt such a thing, despite repeated claims made by President Trump in the run-up to November’s election.

“Americans must have confidence in our voting system and our election infrastructure,” Wray told the Senate Homeland Security Committee. “We are not going to tolerate foreign interference in our elections.”

Sen. Gary Peters (D-Mich.) pressed Wray about claims made by Trump and his supporters that foreign interests could interfere with the election by sending in bogus mail-in ballots. Wray responded by echoing the past assurances from U.S. intelligence officials that they’ve seen no sign of such activity so far in this election cycle.

“We have not seen historically any kind of coordinated national voter fraud effort in a major election, whether it’s by mail or otherwise” Wray said, though he added fraud has been detected “at the local level from time to time.”

The FBI director, seemingly aware that his comments about election interference last week angered the president, said he was “in no way minimizing” any threat to ballots. Changing the outcome of a federal election “would be a major challenge for an adversary,” he said, adding that the FBI “would investigate seriously” if it saw indications of such an effort.

Hours after Wray’s testimony, federal prosecutors in Pennsylvania issued a statement that they had found nine discarded military mail-in ballots as part of an investigation into a small number of such votes. Seven of the nine ballots were marked for Trump, and the other two remained sealed, so the markings on those ballots were unknown, Justice Department officials said after initially declaring that all nine ballots had been cast for the president.

The president’s campaign quickly seized on the statement, tweeting that “Democrats are trying to steal the election.”

Trump has argued that mail-in voting is highly suspect, saying ballots requested by individual voters are secure but that ballot applications sent out based on voter rolls are not. On Thursday he urged people in Florida, an important battleground state, to “make sure to request” a mail-in ballot and submit it.

Thursday’s hearing about threats to the country ranged over topics from the upcoming election, including civil unrest over police misconduct and the hacking of U.S. companies.

Republican senators asked Wray what more could be done to stem the violent flare-ups at some protests that have occurred throughout the country since the spring.

Sen. Ron Johnson (R-Wis.), the committee chairman and a staunch ally of the president, said “the rioting, the anarchy” is the “current greatest threat to our democracy.”

Ken Cuccinelli, the Department of Homeland Security’s acting No. 2 official as head of U.S. Citizenship and Immigration Services, also testified at the hearing, and accused Democrats of inciting rioting.

“So much of the political leadership in the country has encouraged this violence,” Cuccinelli said, singling out House Speaker Nancy Pelosi (D-Calif.) and Portland Mayor Ted Wheeler (D). “We see this rife across large swaths of our political arena.”

Wray, who Trump criticized last week for not being tougher in his comments about antifa activists, tried again to stake out the FBI’s position on the anti-fascist collective.

“Let me try to be as clear as I can about that: antifa is a real thing, it is not a fiction. We have seen organized tactical activity at the local regional level,” Wray said.

The FBI is finding “a lot of the activity is organized at what I would call more of a tactical level than a strategic level, and organized more locally,” he said, adding “that in no way, in no way, diminishes how serious and dangerous it is. We don’t view how nationally organized something is as a proxy for how dangerous it is.”

But he cautioned that some of the people who may be involved in violence have “a mishmash” or “salad bar” of ideologies, and as a result many of them don’t have easily defined motives beyond an attraction to violence.

Sen. Rand Paul (R-Ky.) argued that the Black Lives Matter movement is supporting those creating havoc at protests, and suggested that violent individuals may be flying around the country to do so.

“We need to find out who’s financing them,” said Paul, who along with his wife was pursued by angry protesters weeks ago in Washington and had to be protected by D.C. police. “They’re saying their goal is to terrorize public officials, their goal is terror.”

Wray, who testified last week at a similar hearing before a House committee, indicated then that racially motivated extremism composes the largest share of the FBI’s domestic terrorism cases, and that white supremacist ideology appears to drive most of those cases.

The FBI director has tried with limited success to keep the bureau out of the intensifying partisan fights as the election nears. At last week’s hearing, he told lawmakers that Russia hopes to “denigrate” Trump’s opponent, former vice president Joe Biden, through social media.

The president expressed displeasure with the director’s answers, saying they were not only soft on antifa, but that Wray neglected to mention China would like to see Biden elected. Asked whether he would consider removing Wray over his testimony, the president responded, “We’re looking at a lot of different things.”

“I did not like his answers,” Trump said last week. “I’m not sure he liked them either. I’m sure he probably would agree with me.”

Wray again warned Americans to be on guard against disinformation aimed at manipulating their opinions leading up to Election Day, and to use common sense and good judgment when evaluating what they see online.

“I would encourage people to be critical thinkers, and to get their news from a variety of sources and make up their own mind and be a skeptical, discerning electorate — which is what I think is the best defense against malign foreign influence,” Wray said.