The warning signs were there. In a tweet or offhand remark, President Donald Trump would touch on what he said Ukraine had done to him during the 2016 election. Top Administration officials got an earful. Foreign leaders were treated to the stories. Occasionally his rants would unspool on live TV. “And Ukraine!” Trump shouted down the line to a Fox News host on June 19, the night after he formally announced his re-election bid. “Take a look at Ukraine!” he went on, as the host tried to move to other subjects.

Few people, even those closest to him in the White House, grasped exactly what the President of the United States seemed to believe: that Ukraine, a nation consumed over the past five years by a crippling armed conflict with Russia, had found a way to conspire against him during the 2016 election, and to collude with his rival, Hillary Clinton, by hiding the Democratic National Committee’s email server and feeding her allies dirt about Trump. It was an idea Tom Bossert, his first homeland-security adviser, described as a “completely debunked” conspiracy theory. Few saw in his Ukraine outbursts anything more than the effusions of a cable-news showman.

It took a complaint from an intelligence-community whistle-blower, released late last month, to reveal the weight of Trump’s Ukraine conspiracy theory and just how far the President has gone to support the notion that a vast network of enemies inside and outside his own government has been working against him. Trump has tried to mobilize the vast resources of his presidency–from Attorney General William Barr and the U.S. Justice Department to America’s national-security apparatus–and a team of investigative irregulars, led by his personal lawyer Rudy Giuliani. This band of conspiracy cops has traveled the globe in a disorderly hunt for proof of the conspiracy Trump says is arrayed against him.

In the past, many of his advisers tried to redirect Trump. They urged the President to accept the consensus of U.S. intelligence agencies: the true conspiracy of the 2016 election was that Russia interfered on his side. But those voices are long gone. In their place is a network of far-right Internet denizens, conservative media and members of Trump’s inner circle, advancing theories that have taken shape over the past two years. Those seeds have fallen on fertile ground.

Trump tells aides he is held to a double standard, a White House official tells TIME. Trump sees Joe Biden on tape saying the Obama Administration withheld aid until Ukraine fired its prosecutor, and then feels unfairly criticized for asking Ukraine to help investigate Biden and the origins of the Russia probe. To Trump, the official says, “It feels like people are coming at him over a bunch of bullsh-t while letting all this other stuff slide.” That sense of grievance has helped lead Trump into what Democrats and a handful of Republicans say are potentially impeachable offenses, first among them, using the power of the presidency to try and stay in office.

Trump’s focus on Ukraine turned into an invitation, an open call for a cast of sleuths to deliver the thing he craves: evidence, no matter how thin in substance or dubious in provenance, that he is right about his enemies, that he is the victim of a grand conspiracy and not in fact the purveyor of one. Tracing the origins of the Ukraine conspiracy theory and the President’s efforts to pursue it is central to understanding the political crisis consuming Washington.

TIME journalists, from Washington to Ukraine, have found a tangled mix of fact and fiction. Barr has launched a formal Justice Department investigation of the origins of the Mueller probe. Meanwhile, Giuliani has drawn on a network of sources, including a former prosecutor in Kiev, a wanted fugitive in Vienna and a pair of Russian-speaking businessmen in Miami in pursuit of Trump’s theories.

Trump and Giuliani–egged on by supporters chanting “Investigate the investigators!”–may still believe they will find enough proof to chasten their enemies. But so far their efforts have mostly hurt Trump, his Administration and the country. Barr is frustrated with Giuliani’s role in the unorthodox investigation. The White House counsel’s office is at loggerheads with some more politically minded White House aides over how to respond to the whistle-blower’s revelations. Democrats on the Hill are licking their lips at the opportunity to put Trump up for an impeachment trial. And the nation is struggling to understand where the truth actually lies.

It is perhaps not surprising that one of the first sources of the Ukraine conspiracy theory that has so captured the President’s imagination was the Russian Foreign Ministry in Moscow. As questions mounted over Kremlin interference in the 2016 presidential race, a ministry spokesperson suggested that Ukraine had “seriously complicated the work of Trump’s election-campaign headquarters by planting information” about its chairman, Paul Manafort. “All of you have heard this remarkable story,” the spokesperson, Maria Zakharova, told reporters in November 2016.

Like any good conspiracy theory, this one contained a sliver of truth. The leak that forced Manafort to leave the Trump campaign did come from Ukraine, and one of the people who publicized it was a lawmaker named Serhiy Leshchenko. Before he went into politics, Leshchenko worked as an investigative journalist and an activist against corruption. One focus of his research had been Manafort’s work for a Kremlin ally in Ukraine accused of siphoning at least $37 billion in government money into offshore bank accounts. “I’ve never made a secret of my anger at Manafort,” Leshchenko says. “He helped bring a regime to power that robbed my country.”

In August 2016, the New York Times revealed that Manafort had received more than $12 million in payments from that regime, and he was forced to resign from the Trump campaign. Days later, Leshchenko held a press conference in Kiev calling for Manafort to be investigated. That kindling–a wounded Trump campaign, the New York Times and an obscure Ukrainian lawmaker–would soon start a fire on the Internet, conflating events both real and imagined.

Leshchenko’s calls to investigate Manafort became part of a Ukrainian scheme with Democrats to smear the chairman of the Trump campaign. CrowdStrike, the security firm hired to investigate the hacking of emails from the DNC, was said to have covered up Ukraine’s role and framed Russia instead. And starting soon after his Inauguration, Trump piled on. “I heard [CrowdStrike is] owned by a very rich Ukrainian, that’s what I heard,” Trump told the Associated Press in April 2017. He would continue to repeat in other interviews that the firm was owned by Ukrainians or based there, despite the fact that it is a U.S. company based in Sunnyvale, Calif., with no known ties to Ukraine. Three months later, he cryptically tweeted about “Ukrainian efforts to sabotage Trump campaign” that had been “quietly working to boost Clinton.”

Whenever new allegations of Trump’s Russia ties emerged, his allies would revive the Ukraine theory. As the Mueller probe gained steam in the summer of 2017, Fox News host Sean Hannity devoted segments of his show to the allegations that the Clinton campaign had received help from Ukrainian officials, with a banner of the country’s blue-and-yellow flag reading in all-caps Ukrainian election interference? Trump’s son Donald Jr. amplified the Ukraine theories after his infamous Trump Tower meeting with a Kremlin-linked lawyer became public in July 2017, retweeting that “DNC operatives actively worked with Ukrainian government officials to dig up oppo research,” asking, “No outrage???” Trump’s attorney Jay Sekulow ran with this message on CNN a few days later, referring to “the situation with the Ukrainians and the DNC and the Clinton campaign, where information actually was shared.” Trump’s allies pointed to reporting by Politico and the New York Times that a DNC outreach coordinator had met with Ukrainian officials in Washington and shared information about Manafort’s work in Ukraine with reporters and the DNC.

As the Mueller probe drew to a close in the spring of this year, the President and Giuliani began to speak out more frequently about these theories. “As Russia Collusion fades, Ukrainian plot to help Clinton emerges,” Trump tweeted on March 20, two days before Mueller delivered his final report to the Attorney General.

All along, the pied piper of the Ukraine narrative was Giuliani. On the morning of May 11, a few days after a Senate committee called Trump’s eldest son to testify, Ukraine’s new government awoke to news footage of Giuliani declaring that there were “enemies of the United States” among them. Raising his voice over the anchor’s attempts to interrupt him, Trump’s lawyer even name-checked Leshchenko, the former journalist. He had been in line to join the Cabinet of President Volodymyr Zelensky, but Trump’s lawyer got in the way. “We knew Giuliani is the hand of Trump,” Leshchenko tells TIME. “Once he called me an enemy, it was clear I had to step aside.”

Trump soon took the theories about Ukraine straight to the country’s President. In a phone call on July 25–the day after Mueller’s testimony before Congress–Trump urged Zelensky to do him a favor. “I would like to have the Attorney General call you or your people” about this alleged collusion, Trump said. “And I would like you to get to the bottom of it.”

When the White House released a declassified summary of that call on Sept. 25, it showed just how aggressive Trump had been in pursuit of the matter, and just how varied a team he had enlisted in the effort. While Giuliani is a central player, Barr is second only to Trump in the power he wields in its execution. But when he first learned that Trump had raised his name on the call with Zelensky, the Attorney General was “angry and surprised to be lumped in together with the President’s personal attorney,” not least because Barr has never spoken about Ukraine to Giuliani, a person familiar with Barr’s thinking tells TIME.

But Barr’s role in this story has drawn plenty of attention, and criticism. While Trump publicly mused that Barr’s predecessor, Jeff Sessions, should investigate Ukraine’s role in the events that led to the Mueller probe, one former official who worked under Sessions does not recall the topic ever coming up inside the Justice Department. Barr, by contrast, dived right in.

Shortly after being confirmed to the job in February, Barr instructed the U.S. Attorney for Connecticut, John Durham, to look at “the extent to which a number of countries, including Ukraine, played a role in the counterintelligence investigation directed at the Trump campaign during the 2016 election,” according to a Justice Department statement in September. Asked what the basis for the investigation was, a Justice Department official says, “the Attorney General just saw enough things that weren’t adding up that he knew he needed to look into it.”

Barr himself has taken up the task of digging into the matter. In London this summer, he asked British authorities how much credence they gave former British spy Christopher Steele and a dossier he compiled on Trump’s alleged ties to Russia, two British officials briefed on Barr’s visit tell TIME. British intelligence officials found Barr’s request for information in the probe “rather unusual, coming as it did from the Attorney General instead of the usual channels,” one of the officials tells TIME.

Barr has also enlisted Trump. “At Attorney General Barr’s request, the President has contacted other countries to ask them to introduce the Attorney General and Mr. Durham to appropriate officials,” Justice Department spokesperson Kerri Kupec said in a statement on Sept. 30. Trump has spoken to Australia and possibly other leaders at Barr’s behest.

One troubling question is whether Barr, like Trump, crossed a line from pursuing a suspected conspiracy perpetrated during the last election into investigating Trump’s political rivals in the coming one. The whistle-blower alleged Barr appeared to be “involved” in the effort to “solicit interference from a foreign country in the 2020 U.S. election.” Pressed on whether Barr and Trump had discussed former Vice President Biden in connection with Ukraine, the Justice Department official reported no awareness of any conversations between the Attorney General and the President about Biden and Ukraine.

If Barr is trying to be discreet, Giuliani has been anything but. His pursuit of parallel investigations has triggered alarm at the highest levels of the White House. “The most dangerous stuff is Rudy flying around the world fixing sh-t,” a person close to Trump told TIME.

From Vienna and Kiev to Florida, Giuliani has recruited a cast of helpers in his effort to confirm Trump’s suspicions about Biden, Clinton and Ukraine. Among them was a pair of businessmen from Miami, Igor Fruman and Lev Parnas, who volunteered to be his eyes and ears in Kiev, they have said. Born in the Soviet Union and still connected in Ukraine to businessmen and politicians, the duo have made generous donations to Republican causes since 2016. With their assistance, Giuliani spoke to three politicians in Ukraine who had overseen investigations related to the Biden family. Parnas, Fruman and Giuliani have all spoken publicly about their efforts. “I was doing it because I felt as a U.S. citizen it was my patriotic duty,” Parnas told NPR in September.

So far, the most valuable source for Giuliani in Ukraine has been Viktor Shokin, a former prosecutor general, who spoke to Giuliani over Skype in late 2018. Shokin later wrote a damning 12-page statement accusing Biden of abuse of power during his tenure as Vice President. “I was forced to leave office, under direct and intense pressure from Joe Biden and the U.S. Administration,” in order to stop an investigation of the company where Hunter Biden worked, Shokin wrote.

That account has not stood up to scrutiny. Top officials in the U.S. and Ukraine, as well as independent experts and investigative journalists, have confirmed that Shokin was fired for his alleged corruption, and the investigation of Hunter Biden’s company was dormant at the time.

A parallel track in Giuliani’s efforts has been entrusted to a pair of American lawyers and Fox News regulars, Victoria Toensing and Joe DiGenova, who have worked with Giuliani for years and, according to a recent profile of them in Politico, “enjoy an open line to Trump.” This summer, they went to work for Dmitry Firtash, a Ukrainian tycoon who is wanted in Chicago for alleged corruption. In a legal filing in 2017, the DOJ referred to Firtash as an “upper-echelon associate of Russian organized crime.” He has strongly denied having links to the mafia and is fighting extradition to the U.S. on the bribery charges, which he also denies.

But the Firtash case has become a rich pool of material for Giuliani’s effort to discredit the Mueller investigation. In a legal filing in Vienna in July, lawyers for Firtash claimed that one of Mueller’s top investigators had offered to drop the bribery case against Firtash in exchange for damning testimony on Trump, Toensing and DiGenova tell TIME. “The oligarch,” Giuliani told Fox News on July 22, “basically said, ‘I’m not going to lie to get out of the case.'” (Mueller’s prosecutors have denied ever inappropriately pressuring witnesses to testify against Trump.)

For Trump’s critics, the scariest thing about his efforts to discredit the Mueller probe is the impact it will have on the 2020 election. U.S. intelligence agencies have warned repeatedly that Russia has again set out to influence the vote. “They’re doing it as we sit here,” Mueller told Congress in July.

Trump’s refusal to credit such warnings, and his attempts to cast them as a plot against his presidency, is going to make the Kremlin’s work much easier this time around, says Michael McFaul, a former U.S. ambassador to Moscow. “That is my prediction for what is going to happen in electoral politics in America moving forward,” McFaul tells TIME. Thanks to Trump’s “disinformation campaign,” he says, “Ukraine is going to become the focus of the 2020 elections. And that means Russia is off the hook.”

With reporting by Brian Bennett, Tessa Berenson, Massimo Calabresi, Abby Vesoulis and John Walcott/Washington

This appears in the October 14, 2019 issue of TIME.

Contact us at letters@time.com.