A porn star was paid to keep silent about her alleged dalliance years earlier with a presidential candidate, which a judge has agreed was an illegal violation of campaign finance laws.

The private emails of Democrats were stolen and published, which prosecutors have said was an illegal intervention into the U.S. political system by foreign operatives.

The two crimes were undertaken to help Donald Trump’s campaign in 2016. They led to the indictment or conviction of 13 men, including Trump’s personal attorney.

But for nearly four years, Trump has bullied, browbeaten and litigated his way out of efforts to pin down whether he had involvement in or knowledge of the illicit actions that were undertaken to help his presidential campaign.

Legal experts said his commutation last week of the sentence of confidant Roger Stone, who had been convicted of lying to Congress about his efforts to interact with WikiLeaks while it was publishing the hacked Democratic emails, was part of a pattern in which Trump flexed the powers of his office and his platform to evade scrutiny of his actions.

It is a pattern that vexed special counsel Robert S. Mueller III, who devoted substantial space in his report on election interference to Trump’s tactics but ultimately declined to come to a conclusion as to whether they constituted crimes, an ongoing source of frustration to Democratic lawmakers and some legal experts. And it has emerged as an issue for Trump’s reelection as critics accuse him of corrupting the government and the justice system to serve his personal needs.

“He’s resisted cooperation with all manner of duly authorized investigations — it’s a comprehensive stonewalling to protect his legal and political liabilities,” said Alan Charles Raul, who served as associate counsel to President Ronald Reagan and now is representing Stone jurors in a proceeding to determine whether confidential juror questionnaires will be made public.

“I think he signals clearly to his subordinates, others in government and people outside government that if they don’t rat him out, if they don’t flip and cooperate with government investigators, then they’ll be rewarded. If they do cooperate with criminal or congressional investigations, he will retaliate,” he added.

Trump’s commutation for Stone came after months of praising his old friend for publicly promising to never provide damaging information about the president to prosecutors.

Stone told Fox News’s Sean Hannity this week that his silence was an effort to avoid bearing “false witness against the president” and that he had refused to “lie against my friend of 40 years so they could use it for impeachment.”

In a statement to The Washington Post, he added he has never implied that he knew of misconduct by Trump and remained silent in exchange for clemency. “That is not true,” he said. But in his report, Mueller contemplated whether Stone’s silence was indeed intended to help Trump. Stone has said that he had extensive contact with the candidate during the campaign.

The Stone clemency was only the latest example of Trump’s attempts to tilt the scales of justice in his favor.

Trump refused to be interviewed by Mueller, submitting only written answers that Mueller indicated in his report last year were “incomplete and imprecise.”

He fought all the way to the Supreme Court to avoid turning over documents related to the hush-money payments to the Manhattan District Attorney’s Office — the court ruled last week that Trump does not have blanket immunity for the inquiry but sent the case back to a lower court, meaning more delay.

He berated and threatened witnesses who implicated him in wrongdoing — like his former attorney Michael Cohen, who testified that Trump directed him to pay adult-film actress Stormy Daniels for her silence before the 2016 election.

Meanwhile, Trump praised those who refused to provide information about him, like Stone and former campaign chairman Paul Manafort, who a judge found continued to lie to prosecutors even after pleading guilty to financial crimes related to lobbying work in Ukraine and pledging to cooperate.

The president has publicly castigated judges and jurors who have ruled against his interests, refused to allow top aides to testify before Congress, fired inspectors general within his administration, and, starting with campaign chants about opponent Hillary Clinton, threatened to lock up his enemies and spare his allies.

Trump this week justified extending clemency to Stone by saying the political operative had been caught up in an “investigation that should have never taken place.” He said Stone “wasn’t given a fair trial” and had been “treated very unfairly.” His decision to help his friend, he asserted, was receiving “rave reviews.”

Stone likewise complained to Hannity of “politically motivated prosecutors,” “a biased judge” and a “stacked jury.”

Still, while charges against Stone were initially filed by the special counsel’s office, he was prosecuted not on accusations of lying to the special counsel but of lying to the Republican-led House Intelligence Committee while it was investigating Russian interference in the election.

At Stone’s trial, which took place after Mueller’s office had disbanded, the prosecution was handled by the U.S. attorney’s office in D.C. He was convicted by a jury of 12 citizens and sentenced by a federal judge who said that his lies impeded an investigation that was “a matter of grave national importance.”

Attorney General William P. Barr, who had intervened in the case to push for a lesser sentence than that initially recommended by the career prosecutors who handled it, nevertheless told ABC News last week that the prosecution had been “righteous.”

Despite bragging before the election of having a back channel to WikiLeaks, Stone has since Trump’s victory insisted that his boasts were empty and that he was not in contact with the group and had no advance knowledge of its plans to release documents U.S. intelligence has concluded were stolen by Russian operatives.

But Mueller’s report pointed to the possibility that Stone might have known more than he has so far admitted and could know information that could hurt Trump.

If Mueller had been able to show that Stone tipped off Trump in advance to the WikiLeaks releases, for instance, something both have denied, it would have upended four years of Trump’s narrative about how the 2016 campaign unfolded.

Even had Stone told prosecutors merely that he and Trump spoke about WikiLeaks, his answers would have contradicted Trump’s written answers to Mueller, which were submitted under penalty of perjury. But Stone’s silence meant prosecutors could not explore whether Trump’s answers had been truthful.

In his written submission, the president wrote that he did “not recall discussing WikiLeaks” with Stone, nor did he “recall being aware of Mr. Stone having discussed WikiLeaks with individuals associated with my campaign.”

But in his report, Mueller explained that several other campaign officials testified that during the campaign, Trump had discussed WikiLeaks with Stone, that Trump was told Stone had access to WikiLeaks and that Trump had directed people to stay in contact with Stone about WikiLeaks.

Deputy campaign manager Rick Gates told investigators that Stone told him even before WikiLeaks founder Julian Assange announced in June 2016 that he would publish information related to the campaign that something “big” was coming and that he thought Assange had Hillary Clinton’s emails.

Cohen told prosecutors that shortly before WikiLeaks first released Democratic Party emails in July 2016, he was in Trump’s office in New York when the candidate received a phone call from Stone and placed it on speakerphone. According to Cohen, Stone told Trump that he had just spoken to Assange and learned that the group would be releasing information in a matter of days.

Mueller wrote that evidence existed that Trump “likely understood that Stone could potentially provide evidence that would be adverse to the President.” Mueller wrote that it was possible Trump simply did not have a clear recollection of his campaign conversations with Stone. But he wrote it was also possible Trump’s treatment of Stone demonstrated that he understood that if Stone talked, he’d “provide evidence that would run counter to the President’s denials and would link the President to Stone’s efforts to reach out to WikiLeaks.”

“It seems unprovable — but highly likely to me — that truthful testimony by Roger Stone would have implicated that claim and given lie to it,” said Paul Rosenzweig, a lawyer who served on the independent counsel team that investigated President Bill Clinton.

In a statement, Stone said he was offered “unspecified leniency” by the special counsel team in exchange for evidence he communicated with Russians to help the campaign. He said he had no such evidence and refused — and Mueller could find nothing else to support the allegation in all of his emails, text messages or phone records and ultimately did not claim the allegation against either him or Trump.

Stone noted that he long ago made public his only text exchange with Guccifer 2.0 — the online persona U.S. intelligence would later identify as having been backed by Russian intelligence — that the messages came only after WikiLeaks had published material and that the exchange, which he termed “innocuous and innocent,” provided “no evidence of collusion or collaboration.” “If Mueller had evidence I was involved with Russian efforts to obtain and disseminate stolen data, why didn’t he bring such an indictment?” he wrote.

Ultimately, Mueller also offered no judgment as to whether any of Trump’s efforts to impede or derail the investigation constituted a crime.

But he devoted 36 pages to exploring whether Trump’s treatment of witnesses in the investigation, including Cohen and Stone, as well as former national security adviser Michael Flynn and Manafort, might constitute obstruction of justice.

When it came to Cohen, Trump’s treatment of his former personal attorney changed quickly after Cohen began working with prosecutors.

When Cohen initially lied to reporters and told them he used his own money to pay Daniels $130,000 in exchange for her pre-election silence about a 2006 sexual encounter that Trump has since denied, he soon received a text from another of Trump’s personal attorneys that read, “client says thanks for what you do.” When his home and office were raided by the FBI, Trump called him to tell him to “hang in there” and “stay strong.”

But after Cohen began cooperating with investigators, Trump’s attitude changed. He accused Cohen of lying to get a better deal, called him a “rat,” and said his wife and father-in-law had committed crimes.

Cohen pleaded guilty in 2018 to financial crimes, lying to Congress and campaign finance violations stemming from the hush-money payments. He told a judge that he made the payments at Trump’s direction and later released copies of Trump Organization checks he received as reimbursement, signed by the president and his son Donald Trump Jr.

In 2019, federal prosecutors signaled they had ended their investigation into the matter, but local prosecutors in Manhattan have been exploring whether the Trump Organization falsified business records to conceal the payments to Daniels. Trump has denied Daniels’s account of their liaison but has refused to turn over documents in response to subpoenas in the matter, arguing in court that as president, he has absolute immunity from any criminal investigation.

By a 7-to-2 vote, the Supreme Court last week rejected that argument, saying the president is not above the law. But they sent the case back to lower courts to see whether Trump has any other grounds to resist the subpoenas.

Citing the ruling, Rosenzweig said he does not believe Trump has thwarted inquiry for all time.

“I would say,” he added, “that he has thus far thwarted it quite successfully.”

This story has been updated to include further comment from Stone.

Devlin Barrett and Manuel Roig-Franzia contributed to this report.