Roger Stone heads to trial this week in federal court, where prosecutors plan to dive back into an episode of political chicanery, alleged lies and conspiratorial texts that parallels the nascent impeachment inquiry into his longtime friend President Trump.

The trial of Stone, who has long cultivated a public image as a dirty trickster on the edges of mainstream politics, is due to start Tuesday with jury selection and openings planned Wednesday. He has been charged with lying to Congress and trying to tamper with a witness during a congressional investigation into interference in the 2016 election.

His trial offers the possibility of fresh insights into the strange quest by some in Trump’s orbit for a kind of political kryptonite to use against then-Democratic presidential candidate Hillary Clinton — secret emails that would, they hoped, destroy her candidacy.

After Trump won the presidency, Stone’s role came under intense public scrutiny as a possible conduit between Trump’s campaign and WikiLeaks, the anti-secrecy group that had published Clinton-related emails stolen by Russian government hackers.

The Stone indictment suggests that what prosecutors found instead was a failed conspiracy among conspiracy theorists, bookended by investigative dead ends and unanswered questions for the team of special counsel Robert S. Mueller III.

The 23-page indictment against Stone was the last set of criminal charges leveled by Mueller’s two-year investigation into Russian interference in the 2016 election before he shut down his office earlier this year.

There are, however, a number of unidentified Mueller spinoff cases that could, in theory, still result in criminal cases.

“We don’t know that this will be the last Mueller-related trial, because there are at least a dozen Mueller-referred cases out there, and we will have to see if anything comes of those,” said Randall Eliason, a former federal prosecutor who teaches law at George Washington University. “There’s a lot of crazy atmospherics to the Stone case, but the actual charges are fairly straightforward — it’s about lying, and the government’s best evidence is his own emails and messages.”

Prosecutors aim to show that Stone’s private text and email conversations prove that his statements to lawmakers in 2017 were lies meant to hide the extent of his election-year efforts to learn what dirt WikiLeaks might have against Clinton, and when WikiLeaks might release the information.

Stone is one of Trump’s longest-serving advisers. The pair met in the 1980s when Stone, 67, talked the New York real estate developer into donating to President Ronald Reagan’s campaign. Trump became one of the first clients of Stone’s Washington lobbying and consulting business.

Stone, who had long urged Trump to run for president, chaired Trump’s exploratory committee in the late 1990s under the banner of the Reform Party.

When Trump launched his presidential campaign in mid-2015, Stone briefly served as a formal adviser, and then after a split, an informal sounding board. In March 2016, Stone helped bring his former business partner Paul Manafort into Trump’s campaign, which Manafort eventually chaired. Stone also made an important introduction for Trump: Alex Jones, the noted conspiracy theorist and host of the influential right-wing Infowars website and associated media products.

In the summer of 2016, Stone said in an interview with The Washington Post that he was receiving late-night calls from then-candidate Trump via a blocked number. Those phone calls coincided with fervent behind-the-scenes activity related to anticipation that WikiLeaks was preparing to release emails that could hurt the Clinton campaign.

Along the way, Stone interacted with then-Trump campaign official Stephen K. Bannon, who is expected to be a trial witness. Past emails suggest Bannon did not think much of Stone’s claims of inside information, but Stone’s exchanges with two other individuals make up the heart of the prosecutors’ case.

One of those individuals is Jerome Corsi, a conspiracy theorist best known for promoting the false claim that Barack Obama was not born in the United States. Prosecutors say that in late July 2016, a senior Trump campaign official made contact with Stone seeking to learn what information WikiLeaks had. Stone, according to the indictment, had claimed to Trump campaign officials in June and July that he “had information indicating (WikiLeaks) had documents whose release would be damaging to the Clinton Campaign.”

Stone, in turn, allegedly tasked Corsi in late July with getting information about WikiLeaks’ plans. Corsi replied by email on Aug. 2, according to the indictment, that WikiLeaks founder Julian Assange “plans 2 more dumps. One shortly after I’m back. 2nd in Oct. Impact planned to be very damaging.”

Corsi would later say he did not have any direct contact with WikiLeaks, and during the course of the investigation he made a number of claims that prosecutors could not confirm, according to people close to the case. At one point, prosecutors pressed Corsi to plead guilty to lying, but he balked, and the Justice Department dropped the matter.

Stone has told The Post that he spoke with Trump on Aug. 3, the day after he received Corsi’s email, but not about the WikiLeaks tip.

“It just didn’t come up,” Stone said in an interview with The Post. “I am able to say we never discussed WikiLeaks.”

Over the course of August 2016, Stone made several public pronouncements, some based on his back-and-forth with Corsi. Five days after his August call with Trump, Stone told a Republican group in South Florida that WikiLeaks was poised to release documents about the Clinton Foundation.

Stone claimed to have a “back channel” providing inside knowledge of WikiLeaks’ plans. Many of those claims ended up being untrue, but on Aug. 21, 2016, he tweeted: “Trust me, it will soon Podesta’s time in the barrel.” Stone has asserted that the tweet has been misinterpreted as referring solely to Clinton campaign chairman John Podesta. Instead, he has said, the apostrophe was a typo and he meant for the tweet to refer to both Podesta and his lobbyist brother, Tony.

That tweet seemed critically important two months later, when, on Oct. 7, WikiLeaks released the first of thousands of emails hacked from Podesta’s Gmail account. Suddenly, it seemed as if Stone really did have inside access and may even have been conspiring with WikiLeaks, which was, according to U.S. intelligence agencies, being used by Russian spies to try to influence the U.S. presidential election.

Podesta speculated that the Trump campaign had gotten advance warning of the release of emails, and Stone became the subject of speculation that he may have been a conduit between WikiLeaks and the Trump campaign. Stone and WikiLeaks denied that suggestion.

When Stone was charged more than two years later, the indictment made no mention of the tweet that had generated so much suspicion. Instead of being a conduit to Russian intelligence, the document suggests, Stone was a self-promoting spinmeister whose claims of having important connections may have inadvertently landed him in serious legal trouble.

The seven-count indictment alleges that after Stone’s efforts to use Corsi to engage with Assange, Stone turned to someone else as a possibility: former radio host Randy Credico, who interviewed Assange in late August 2016.

In a 2017 interview with the House Intelligence Committee, Stone allegedly lied when he denied having texts or emails about his 2016 discussions surrounding WikiLeaks, said that he had only one associate who tried to act as a go-between with Assange, and never spoke to anyone in the Trump campaign about WikiLeaks’ plans.

Shortly after those denials, Stone’s story began to fall apart, prosecutors say.

On Dec. 1, 2017 — the day former national security adviser Michael Flynn pleaded guilty to lying to the FBI — Stone engaged in an angry back-and-forth with Credico via text about the growing legal pressure.

Stone allegedly told Credico that he should do a “Frank Pentangeli” in his appearance before the same committee — a reference to a gravelly voiced Mafia character in the movie “Godfather: Part II,” who, when called to testify to Congress, suddenly feigns forgetting incriminating information about his mobster boss. The judge overseeing the Stone trial has ruled that for jurors to understand the movie reference, they can read a transcript of the scene but cannot watch it.

Credico is not identified by name in the Stone indictment but is referred to as “Person 2.” Multiple people familiar with the case have confirmed that Person 2 is Credico.

The day of the Flynn plea, Credico texted Stone: “You need to amend your testimony before I testify,” to which Stone replied: “If you testify you’re a fool … I guarantee you are the one who gets indicted for perjury if you’re stupid enough to testify.”

As the investigations wore on, the two increasingly turned against each other, according to evidence in the case.

In April 2018, Stone was so angry that he allegedly texted to Credico: “You are a rat. A stoolie” and vowed to “take that dog away from you,” which prosecutors say was a threat to kidnap Credico’s fluffy white dog, named Bianca. Credico later brought Bianca with him when he testified in front of a Washington grand jury.

A month later, according to the indictment, Credico wrote an email to Stone, saying, “You should have just been honest with the house Intel committee … you’ve opened yourself up to perjury charges like an idiot.”

Stone, a self-described “agent provocateur,” has used his prosecution in social media and in court filings to rally Trump supporters, attack the Justice Department’s Russia investigation and contest its central finding of Russia’s “sweeping and systemic” cyber-interference in the 2016 election.

But he has been repeatedly slapped down by U.S. District Judge Amy Berman Jackson, who said he “has not come close” to showing that the government misled the judges who approved the warrants exploring Russian involvement.

Jackson has held open the possibility of a contempt hearing for Stone after his trial for what she has called his repeated “middle-school” pretrial behavior in online postings, despite a court order that he not make public comments attacking his indictment, the conduct of the FBI, intelligence agencies and government officials.

Jackson entered a gag order and banned Stone from Instagram, Twitter and Facebook until after his trial, after Stone ignored her warnings and his Instagram account showed a photograph of the judge’s face next to what appeared to be the crosshairs of a gun scope.

Rachel Weiner contributed to this report.