If President Trump felt the walls closing in on him Tuesday, he didn’t immediately show it.

His longtime personal attorney, Michael Cohen, had just implicated him in a criminal conspiracy to pay hush money to women who alleged affairs with Trump, while his former campaign chairman, Paul Manafort, was convicted by a jury on tax- and bank-fraud charges — the first trial victory for special counsel Robert S. Mueller III in his investigation of Trump associates and Russia.

Addressing reporters ahead of a campaign rally in West Virginia, Trump sought to distance himself from the Manafort case and ignored the perilous Cohen guilty pleas altogether.

“I must tell you that Paul Manafort’s a good man,” Trump said. “Doesn’t involve me, but I still feel, you know, it’s a very sad thing that happened. This has nothing to do with Russian collusion. . . . This is a witch hunt that ends in disgrace.”

The rapid developments in federal court on Tuesday amounted to a breathtaking political nightmare for Trump, who is already besieged by Mueller’s wide-ranging federal investigation into Russian interference in the 2016 campaign and his possible obstruction of justice. The ramifications could extend to this fall’s midterms and beyond, whether as a cudgel for Democrats who oppose him or as a rallying cry for Republicans eager to stave off congressional investigations.

“It’s really the giant beginning of the unraveling of the Trump presidency. You’re now having a situation where Donald Trump seems to have behaved in a felonious fashion,” said Douglas Brinkley, a presidential historian. “It may make some Republicans not want to go out and vote in November because of the stench emanating from the Trump White House. . . . I think the word ‘impeachment’ is back in play.”

Trump has raged to aides for several weeks that he is often mentioned in connection with the Manafort case and that he shouldn’t be. Several advisers to Trump had already begun discussing how to use a not-guilty verdict regarding Manafort against the Mueller probe. Now, the challenge will be trying to discredit Cohen, two advisers said.

Former Trump political strategist Stephen K. Bannon argued that the two cases will help galvanize GOP support.

“This clarifies that you have to show up on Election Day, you have to double down on intensity because it reinforces that Trump is at war,” Bannon said.

But David Axelrod, a Democratic strategist and longtime adviser to former president Barack Obama, said that Tuesday “was a catastrophic day. In the case of Cohen, he stood up in a courtroom and implicated the president in a crime. It is stunning.”

Steve Schmidt, a veteran political strategist who recently left the Republican Party because of his opposition to Trump, said it could prove to be the most consequential day of Trump’s presidency.

“What it shows is a presidency in crisis, but also the absolute moral and character rot that meanders through American politics in this hour of our nation’s life,” Schmidt said. “The bill is coming due for Trump with regard to his many years of lawlessness and arrogance.”

On Cohen’s plea implicating Trump in two counts of ­campaign finance violations, the White House deferred comment to the president’s outside counsel, Rudolph W. Giuliani, who said in a statement: “There is no allegation of any wrongdoing against the President in the government’s charges against Mr. Cohen. It is clear that, as the prosecutor noted, Mr. Cohen’s actions reflect a pattern of lies and dishonesty over a significant period of time.”

Sam Nunberg, a former political adviser to Trump who worked closely with Cohen, said of Tuesday’s developments: “For any other president, this would be catastrophic. But I don’t think Mueller has gotten any closer to removing Trump from office today.”

Still, Trump, who boasts of his track record hiring “the best people,” must grapple with the reality that a growing number of advisers are finding themselves on the wrong side of the law.

Manafort — a longtime Trump associate who served as his campaign chairman, overseeing the Republican National Convention, the launch of his general election campaign and his selection of Vice President Pence — was convicted of tax- and bank-fraud charges.

Cohen, who for more than a decade was Trump’s personal lawyer and fixer, helping secure the silence of at least two women who alleged sexual encounters with Trump, pleaded guilty to eight violations of banking, tax and campaign finance laws.

“Anytime your lawyer is convicted of anything it’s probably not a good day,” said Sen. Lindsey O. Graham (R-S.C.).

Michael Flynn, Trump’s first national security adviser and a campaign trail confidant, pleaded guilty to lying to the FBI about contacts he had with Russian officials and is cooperating with Mueller in the Russia probe.

“These three names — Flynn, Manafort and Cohen — two summers ago at this time were the biggest stars in the Trump campaign firmament,” Axelrod said. “Now they’ve all crashed. The growing list of people being ensnared in this, it is the tide rising, and I think the president’s behavior reflects the sense that he’s now waist-deep.”

Rick Gates, Manafort’s deputy on the campaign who remained with the campaign well past Manafort’s ouster and was a top adviser to Trump and his senior team during the transition, pleaded guilty to conspiracy and making false statements. He also is cooperating with Mueller.

Rep. Chris Collins (R-N.Y.), who was the first sitting congressman to endorse Trump’s campaign and served on his transition team, was charged with lying to the FBI and insider trading. The second congressman to endorse him, Republican Rep. Duncan D. Hunter of California, was indicted Tuesday on charges of spending campaign money on personal expenses.

For months, aides and advisers to Trump said that Cohen could be the biggest challenge to him. Trump told people that Cohen was not “smart or loyal” and that he wanted to destroy him, said a former senior administration official.

One Trump adviser said of Cohen’s plea and the president: “It feels very different. This feels like everything has caught up to him. People are having conversations tonight that they weren’t having yesterday. I can promise you that.”

The president was angrier about the Cohen news than the Manafort verdict, two officials said. “He was unhappy and exasperated,” an official said.

Trump was in a foul mood en route to the Charleston, W.Va., rally, an adviser said. He did not mention the counts against Cohen or Manafort during the first hour of the event, but did rail against Mueller’s probe of Russian interference. At one point, rallygoers mounted a chant of “Lock her up!” aimed at Hillary Clinton, Trump’s 2016 Democratic opponent.

“Fake news and the Russian witch hunt. We’ve got a whole, big combination,” Trump said at the rally. “Where is the collusion? You know, they’re still looking for collusion. Where is the collusion? Find some collusion!”

Felicia Sonmez contributed to this report.