It was a bad week for President Donald J. Trump. But it could have been so much worse.

In Vietnam, Mr. Trump walked away from his second summit with North Korean dictator Kim Jong Un after the two leaders failed to strike a deal to denuclearize the country. But much to the relief of diplomats and Korea experts, Mr. Trump did not agree to a bad deal.

Meanwhile in Washington, Michael Cohen, Mr. Trump’s former lawyer and fixer, was denouncing him, under oath, in front of Congress and the public, as a “racist,” a “con man,” and “a cheat.”

TRUMP KNOWS EXACTLY WHAT HE WANTS FROM NORTH KOREA (AND SHOULD NOT BE UNDERESTIMATED)

But Cohen, who will soon begin a three-year prison sentence for campaign finance violations, lying to Congress and other crimes, did not say he had evidence that Mr. Trump had colluded with Russia in the 2016 campaign, or that he had explicitly asked him to lie to Congress about his company’s secret negotiations to build a hotel in Moscow.

The challenge for President Trump at home and abroad is what comes next. On both fronts, he faces diplomatic and political peril.

"Sometimes you have to walk," Trump said at a news conference in Hanoi, asserting that his decision was prompted by Kim’s insistence that all sanctions be lifted against Pyongyang in exchange for the closure of Yongbyon, the main nuclear enrichment site (an explanation that the North Korean foreign minister quickly contradicted).

U.S. intelligence experts believe that North Korea has at least two other such facilities. The administration had been hoping to get a comprehensive, verifiable list of nuclear material and facilities from Pyongyang as an initial step toward denuclearization, as well as other concessions, in exchange for the opening of liaison offices, a declaration of intent to make peace, or other concrete steps that would further defuse tension on the Korean Peninsula.

Critics like Sen. Robert Menendez, D-N.J., who chairs the Senate Foreign Relations Committee, were quick to say that the summit’s collapse shows that Trump is a foreign policy “amateur” who was outfoxed by a brutal autocrat.

But many Korea experts welcomed Trump’s decision to walk away. “Better no deal than a bad deal,” said Thomas Byrne, the president of the Korea Society. A deal that would not lead to “full, verifiable, irreversible denuclearization,” one that would have accepted North Korea’s status as a nuclear power, would have weakened America’s alliance with South Korea and Japan and proven destabilizing, he said.

Robert Einhorn, who worked on nuclear proliferation challenges during almost every administration since President Nixon, also expressed relief that President Trump did not make “unwise concessions” to boost his reelection prospects. “He didn’t do that,” Einhorn wrote in an email.

Einhorn also wrote that the president was relatively “statesmanlike” at his press conference after the meeting with Kim. There was “no anger, no recriminations,” he said. And Trump’s positive tone has kept the door open “for future progress.” Denuclearization, if possible, he said, would be a “long, incremental process.”

While Trump and Secretary of State Mike Pompeo said that American and North Korean officials would continue trying to narrow their differences, North Korea’s foreign minister and Trump gave conflicting versions of why the Hanoi summit had failed.

Einhorn worries that the American goal of denuclearization may not be achievable no matter what economic incentives Trump’s team offers, he wrote last fall. “I don’t believe Kim Jong Un has any intention of completely giving up his nuclear deterrent…their ‘mighty sword,’” he wrote. That view is shared by the administration’s top intelligence officials, including Dan Coates, who openly contradicted Trump’s more optimistic view of North Korea’s denuclearization prospects in recent testimony on Capitol Hill.

So while President Trump was justified in trying to test whether Kim – a young, relatively new, albeit brutal and repressive leader – is willing to denuclearize in exchange for the lifting of sanctions and the potential to develop his country economically, it remains unclear whether further talks at the working level will be able to narrow the vast gaps between the two sides.

Nicholas Burns, a veteran diplomat and nonproliferation expert, tweeted that Mr. Trump must now begin to “rebuild sanctions pressure on Kim.” But that, he also warned, would be “a difficult sell with Beijing, Moscow and Seoul, as the two summits have given Kim global legitimacy he never had before.” The symbolism of the 2018 Singapore summit and the handshake in Hanoi may well have a heavy diplomatic price.

Despite team Trump’s rosy spin on the meeting, it remains unclear whether Trump will be more successful than his predecessors in persuading North Korea to give up its nuclear arsenal, now estimated to total between 35-60 nuclear weapons.

Though he can claim credit for having persuaded Kim to suspend nuclear and ballistic missile testing and to return the remains of American POWs killed in Korea (albeit by cancelling joint military exercises with South Korea), the summit should remind us that the deal he initially claimed would be easy to do, may not, in fact, be doable.

At home, Trump dismissed Cohen’s depressing testimony in a trademark tweet. Noting that his former lawyer had just been disbarred for “lying and fraud,” he accused him of “lying in order to reduce his prison time.”

CLICK HERE TO GET THE FOX NEWS APP

While much of Cohen’s portrayal of his former boss may not surprise Americans who have closely followed Trump before and during his presidency, he should be more concerned about what Cohen didn’t tell the senators. Asked whether he was aware of other criminal conduct by his former boss, Cohen said yes, but declined to elaborate at the request of prosecutors in the Southern District of New York.

Trump may have more bad weeks coming.

CLICK HERE TO READ MORE BY JUITH MILLER