The limping conclusion to John H. Durham’s four-year investigation of the Russia inquiry underscores a recurring dilemma in American government: how to shield sensitive law enforcement investigations from politics without creating prosecutors who can run amok, never to be held to account.

At a time when special counsels are proliferating — there have been four since 2017, two of whom are still at work — the much-hyped investigation by Mr. Durham, a special counsel, into the Russia inquiry ended with a whimper that stood in contrast to the countless hours of political furor that spun off from it.

Mr. Durham delivered a report that scolded the F.B.I. but failed to live up to the expectations of supporters of Donald J. Trump that he would uncover a politically motivated “deep state” conspiracy. He charged no high-level F.B.I. or intelligence official with a crime and acknowledged in a footnote that Hillary Clinton’s 2016 presidential campaign did nothing prosecutable, either.

Predictably, the report’s actual content — it contained no major new revelations, and it accused the F.B.I. of “confirmation bias” rather than making a more explosive conclusion of political bias — made scant difference in parts of the political arena. Mr. Trump and many of his loyalists issued statements treating it as vindication of their claims that the Russia inquiry involved far more extravagant wrongdoing.

“The Durham Report spells out in great detail the Democrat Hoax that was perpetrated upon me and the American people,” Mr. Trump insisted on social media. “This is 2020 Presidential Election Fraud, just like ‘stuffing’ the ballot boxes, only more so. This totally illegal act had a huge impact on the Election.”

Mr. Trump’s comparison was unintentionally striking. Just as his and his supporters’ wild and invented claims of election fraud floundered in court (Fox News paid a $787.5 million settlement for amplifying lies about Dominion Voting Systems), the political noise surrounding Mr. Durham’s efforts ultimately ran up against reality.

In that sense, it was less that Mr. Durham failed to deliver and more that Attorney General William P. Barr set him up to fail the moment he assigned Mr. Durham to find evidence proving Mr. Trump’s claims about the Russia investigation.

There were real-world flaws with the Russia investigation, especially how the F.B.I. botched applications to wiretap a former Trump campaign adviser. But the Justice Department’s inspector general, Michael E. Horowitz, found those problems, leaving Mr. Durham with depleted hunting grounds.

Indeed, credit for Mr. Durham’s only courtroom success, a guilty plea by an F.B.I. lawyer who doctored an email during preparations for a wiretap renewal, belongs to Mr. Horowitz, who uncovered the misconduct.

At the same time, Mr. Horowitz kneecapped Mr. Durham’s investigation by finding no evidence that F.B.I. actions were politically motivated. He also concluded that the basis of the Russia inquiry — an Australian diplomat’s tip related to the release of Democratic emails hacked by Russia — was sufficient to open a full investigation.

Before Mr. Horowitz released his December 2019 report, Mr. Durham lobbied him to drop that finding, arguing the F.B.I. should have instead opened a preliminary inquiry. When Mr. Horowitz declined, Mr. Durham issued an extraordinary statement saying he disagreed based on “evidence collected to date” in his inquiry.

But even as Mr. Durham’s report questioned whether the F.B.I. should have opened it as a lower-level investigation, he stopped short of stating that opening a full one violated any rule.

A remaining rationale for the Durham investigation was that Mr. Horowitz lacked jurisdiction to scrutinize spy agencies. But by the spring of 2020, according to officials familiar with the inquiry, Mr. Durham’s effort to find intelligence abuses in the origins of the Russia investigation had come up empty.

Instead of wrapping up, Mr. Barr and Mr. Durham shifted to a different rationale, hunting for a basis to blame the Clinton campaign for suspicions surrounding myriad links Trump campaign associates had to Russia.

By keeping the investigation going, Mr. Barr initially appeased Mr. Trump, who, as Mr. Barr recounted in his memoir, was angry about the lack of charges as the 2020 election neared.

But Mr. Barr’s public statements about Mr. Durham’s investigation also helped foster perceptions that he had found something big. In April 2020, for example, he suggested in a Fox News interview that officials could be prosecuted and said: “The evidence shows that we are not dealing with just mistakes or sloppiness. There is something far more troubling here.”

Mr. Trump and some of his allies in the news media went further, stoking expectations among his supporters that Mr. Durham would imprison high-level officials. Those include the former directors of the F.B.I. and C.I.A., James B. Comey and John O. Brennan, and Democratic leaders like Barack Obama, Hillary Clinton and Joseph R. Biden Jr.

In fact, Mr. Durham only ever developed charges against two outsiders involved in efforts to scrutinize links between Mr. Trump and Russia, accusing them both of making false statements to the F.B.I. and treating the bureau as a victim, not a perpetrator.

While in office, Mr. Barr worked closely with Mr. Durham, regularly meeting with him, sharing Scotch and accompanying him to Europe. When it became clear that Mr. Durham had found no one to charge before the election, Mr. Barr pushed him to draft a potential interim report, prompting Mr. Durham’s No. 2, Nora R. Dannehy, to resign in protest over ethics, The New York Times has reported.

Against that backdrop, the first phase of Mr. Durham’s investigation — when he was a U.S. attorney appointed by Mr. Trump, not a special counsel — illustrates why there is a recurring public policy interest in shielding prosecutors pursuing politically sensitive matters from political appointees.

But the second phase — after Mr. Barr made him a special counsel, entrenching him to remain under the Biden administration with some independence from Attorney General Merrick B. Garland — illustrates how prosecutorial independence itself risks a different kind of dysfunction.

The regulations empowered Mr. Garland to block Mr. Durham from an action, but only if it was “so inappropriate or unwarranted under established departmental practices that it should not be pursued” and required him to tell Congress. Mr. Garland gave Mr. Durham free rein, avoiding Republican accusations of a cover-up.

Mr. Durham continued for another two and a half years, spending millions of dollars to bring the two demonstrably weak cases involving accusations of false statements; in each instance, a jury of 12 unanimously rejected the charges. One of Mr. Durham’s handpicked prosecutors resigned from his team in protest of the first of those indictments, The Times has reported.

But Mr. Durham’s use of his law enforcement powers did achieve something else. He used court filings to insinuate a theory he never found evidence to charge: that the Clinton campaign conspired to frame Mr. Trump for collusion. Those filings provided endless fodder for conservative news media.

Even after Mr. Durham’s cases collapsed, some Trump supporters held out hope that his final report would deliver a bombshell. But it largely consisted of recycled material, interlaced with conclusions like Mr. Durham’s accusation that the F.B.I. had displayed a “lack of analytical rigor.”

Mr. Durham’s own analytical rigor was subject to scrutiny. At one point he wrote that he had found “no evidence” that the F.B.I. ever considered whether Clinton campaign efforts to tie Mr. Trump to Russia might affect its investigation.

Yet the same page cited messages by a top F.B.I. official, Peter Strzok, cautioning colleagues about the Steele dossier, a compendium of claims about the Trump campaign’s ties to Russia that, it later became clear, were Clinton campaign-funded opposition research. He wrote that it “should be viewed as intended to influence as well as to inform” and whoever commissioned it was “presumed to be connected to the campaign in some way.”

As Mr. Horowitz uncovered and criticized, the F.B.I. later cited the Steele dossier in wiretap applications, despite learning a reason to doubt its credibility. But Trump supporters often go further, falsely claiming that the F.B.I. opened the entire Russia investigation based on the dossier.

Mr. Durham’s report appeared to nod to that false claim, saying that “information received from politically affiliated persons and entities” in part had “triggered” the inquiry. Yet elsewhere, his report acknowledged that the officials who opened the investigation in July 2016 had not yet seen the dossier, and it was prompted by the Australian diplomat’s tip. He also conceded that there was “no question the F.B.I. had an affirmative obligation to closely examine” that lead.

Tom Fitton, a Trump ally and the leader of the conservative group Judicial Watch, expressed disappointment in the Durham investigation in a statement this week, while insisting that there had been a “conspiracy by Obama, Biden, Clinton and their Deep State allies.”

“Durham let down the American people with few and failed prosecutions,” Mr. Fitton declared. “Never in American history has so much government corruption faced so little accountability.”

But Aitan Goelman, a lawyer for Mr. Strzok, said that while the special counsel accused the F.B.I. of “confirmation bias,” it was Mr. Durham who spent four years trying to find support for a preformed belief about the Russia investigation.

“In fact, it is Mr. Durham’s investigation that was politically motivated, a direct consequence of former President Trump’s weaponization of the Department of Justice, an effort that unanimous juries in each of Mr. Durham’s trials soundly rejected,” he said.

Adam Goldman contributed reporting.