The US justice department’s internal watchdog was caught in a political tug of war on Wednesday as Republican and Democratic senators used his report on the origins of the Russia investigation involving Donald Trump’s 2016 campaign to support their contrasting views that it was either a legitimate inquiry or a badly bungled farce.

The inspector general, Michael Horowitz, on Wednesday firmly stood by his report, published on Monday, that concluded that although FBI agents made some significant errors as they began their investigation of Trump’s campaign, examples of sloppiness were far outweighed by the gravity of the legitimate legal justification for launching the inquiry, which was taken over by the special counsel Robert Mueller in 2017.

Donald Trump and the attorney general, William Barr, attacked Horowitz’s report after its release. Barr has launched his own reinvestigation of the Trump-Russia inquiry.

Testifying before the Senate judiciary committee on Wednesday, Horowitz said: “My defense of my team and my work is that we stand by the report. Nothing I’ve heard changed our view.”

William Barr suggests FBI acted in 'bad faith' over Russia investigation Read more

He added: “The department, the attorney general, the deputy attorney general, the FBI director, whomever is free to disagree with my conclusions. I didn’t take the [inspector general] job to be popular, to not have my feelings hurt.”

The hearing was the latest reflection of Washington’s intense politicization. Senators from both parties praised a detailed, nuanced report by a widely respected, nonpartisan investigator, while pressing him to call attention to findings that back their positions.

Horowitz himself tried to strike a balance. He insisted that the FBI should not feel comforted by his findings while pointing out the absence of evidence for some of the most sensational claims by Trump and his supporters: that the investigation into ties between his presidential campaign and Russia had been opened for political reasons, that agents had infiltrated his election bid or that Barack Obama had directed a wiretap of Trump.

But he spoke throughout the hearing of serious problems that he said underscored the need for policy changes at the FBI.

Among them, he said, were flaws and omissions in how the FBI prepared its applications for court approval to eavesdrop on a former Trump campaign aide, as he rebuked officials for failing to update judges as they learned new information that undercut some of their original assertions.

“It doesn’t vindicate anybody at the FBI who touched [the applications], including leadership,” Horowitz said. That was a rejection of the views of the former FBI director James Comey, who had claimed vindication for the bureau based on Horowitz’s conclusions.

Republicans and Democrats pressed Horowitz on whether he believed the FBI had acted with partisan bias. His response was hedged: he said the multitude of errors during the surveillance warrant process, which included the altering of an email by an FBI lawyer, was so “inexplicable” and yielded no obvious explanations that he could not be confident about the intention.

Even so, Horowitz also repeatedly noted under questioning from Democrats that he had not found that the FBI had targeted Trump for investigation for political reasons. The investigation was opened for a proper cause, he said, after the FBI received information that a Trump campaign aide had been told that Russia had information that could hurt the presidential campaign of Trump’s Democratic rival, Hillary Clinton.

“It finds that it was a properly predicated investigation based on the rules on the FBI,” Horowitz said of his report.

