WASHINGTON – Attorney General William Barr said Wednesday he thought “spying” on a political campaign occurred in the course of intelligence agencies’ investigations into Russian interference in the 2016 election – a startling assertion by the nation’s top law enforcement official.

Barr’s surprising comments echo attacks President Trump has made against the FBI, and though the attorney general later made clear he was concerned about the legal basis for surveilling political figures, his words provide fresh ammunition to those who have branded the Russia investigation an illegitimate attempt to derail Trump’s presidency.

At a hearing before the Senate Appropriations Committee, Barr was asked about his statement a day earlier that he would review how the FBI launched the counterintelligence investigation that sought to determine whether Trump’s associates were interacting with Russians during the 2016 presidential campaign.

“I think spying on a political campaign is a big deal. It’s a big deal,” said Barr, noting that there are long-held rules to prevent intelligence agencies from collecting information on domestic political figures.

“I’m not suggesting that those rules were violated, but I think it’s important to look at that,” he said. “I’m not talking about the FBI necessarily but intelligence agencies more broadly.”

Sen. Jeanne Shaheen, D-N.H., asked: “You’re not suggesting that spying occurred?”

Barr answered: “I think spying did occur, yes. I think spying did occur.” He added, though, that the key question is whether law enforcement officials had a proper legal justification to open such an investigation and conduct intelligence-gathering.

“I need to explore that. . . . I want to say that I am reviewing this. I haven’t set up a team yet,” Barr added. “I also want to make clear this is not launching an investigation of the FBI. Frankly, to the extent that there were any issues at the FBI, I do not view it as a problem that’s endemic to the FBI. I think there was probably a failure among a group of leaders there in the upper echelon.”

Barr’s comments sparked an immediate response from the House, where the Judiciary and Oversight committees jointly spent the bulk of 2018 looking into the FBI’s conduct during its probes of Trump’s campaign and Hillary Clinton’s use of a private email server while she was secretary of state.

Rep. Mark Meadows, R-N.C, a close ally of the president’s, cheered Barr’s plans to look into allegations of spying, calling it “massive” and in line with evidence the GOP-led investigation uncovered. House Judiciary Committee chairman Rep. Jerrold Nadler, D-N.Y., said Barr’s comments “directly contradict” what Justice Department officials had previously said to the committee.

A lawyer for former FBI director James Comey did not immediately respond to a request for comment. Current and former law enforcement officials have defended their handling of the Russia investigation, saying it was conducted carefully and was based on available evidence, and they have firmly denied engaging in political spying. Those current and former officials have argued that they were obligated to investigate allegations that Trump associates possibly were conspiring with Russians to interfere in the election.

Other officials familiar with Barr’s concerns said the attorney general is focused on understanding investigative steps taken by the FBI in the summer of 2016, and how FBI leaders decided in 2017 to open an investigation into then-Attorney General Jeff Sessions.

Shortly before Wednesday’s hearing began, Trump renewed his attack on the FBI’s investigation, telling reporters, “It was started illegally.”

“Everything about it was crooked, the president said. “. . . This was an attempted coup.”

Barr told lawmakers that his review may scrutinize senior FBI officials’ conduct at the time.

“I feel I have an obligation to make sure that government power is not abused. I think that is one of the principal roles of the attorney general,” he said.

Later in the hearing, Barr offered a more tempered description of his concerns, saying that he wanted to understand whether there was “unauthorized surveillance” of political figures. “I believe there is a basis for my concern, but I’m not going to discuss the basis for my concern,” Barr said. “I am not saying that improper surveillance occurred. I am saying I am concerned about it, and I am looking into it. That is all.”

“Spying” can be a loaded term with different meanings in political and legal circles. Barr made clear that he was concerned about the legal basis for taking investigative steps such as court-ordered surveillance.

“Have you any evidence that there was anything improper in those investigations?” asked Sen. Jack Reed, D-R.I.

“I have no specific evidence that I would cite right now,” Barr replied. “I do have questions about it.”

At another point, Barr said he did not understand why, if intelligence officials believed there was a danger of Russian figures trying to make inroads with Trump associates, the FBI did not warn the campaign about those specific risks.

“If I were attorney general and that situation came up, I would say, ‘Yes, brief the target of the foreign espionage activity,’ ” Barr said. “I want to satisfy myself that there were no abuse of law enforcement and intelligence powers.”

Lawmakers also questioned Barr about the anticipated release of special counsel Robert Mueller III’s report detailing his 22-month investigation of Russia’s efforts to influence the election. He indicated that a redacted version would be made public “hopefully next week.”

Mueller completed his investigation last month and submitted a nearly 400-page report to Barr. The attorney general then released a letter saying the investigation did not find a conspiracy between Russia and the Trump campaign, and that Mueller did not reach a conclusion about whether the president may have tried to obstruct justice during the probe. After reviewing Mueller’s evidence, Barr and his deputy, Rod Rosenstein, determined that they could not make a case that the president had obstructed justice.

Since that announcement on March 24, Barr has said he has been redacting portions of the report that contain grand jury information, sensitive intelligence-gathering details, details that could affect ongoing investigations, and information that would violate the privacy interests of “peripheral” figures in the Mueller probe.

The redaction process has raised suspicions among Democrats that Barr is trying to hide damaging information about the president, concerns that intensified after recent reports indicating some on Mueller’s team are unhappy with the brevity of Barr’s initial statement to Congress, and that they think more could and should be said about the seriousness of what investigators had found.

The attorney general said Wednesday that none of Mueller’s report was releasable “as I received it, because none of it had been vetted for [grand jury] material.”

Barr would not say whether anyone at the White House has been briefed on the report’s contents, and he told the panel’s senior Democrat, Sen. Patrick Leahy of Vermont, that he has not overruled Mueller on any recommendation regarding redactions, whether to omit certain information or leave it visible.