The drama drew Trump's attention even amid sensitive denuclearisation talks.
Even before the hearing began, the President unleashed an attack on his former fixer, who has pleaded guilty to lying to Congress and campaign finance violations and has been sentenced to three years.
In a tweet, Trump downplayed Cohen's influence and claimed he was "lying in order to reduce his prison time".
Later, as he sat for a photo with Kim, Trump bristled at reporters' questions about Cohen.
After the event, the White House took the extraordinary step of barring four US reporters, including one from AP, from Trump's dinner with Kim, citing the "sensitivities" of the meeting.
Democrats consider Cohen their star witness as they kick off investigations into Trump's business practices, presidential campaign and embattled charitable foundation, including any payments relating to efforts to influence the 2016 election.
He was initially due on Capitol Hill this month, but his appearance was delayed.
The President's son Donald jnr accused Democrats of timing the hearing to interfere with Trump's trip abroad.
Cohen's testimony appeared designed to get under Trump's skin.
Reading from his prepared remarks, Cohen said Trump instructed him to threaten schools that Trump attended to prevent release of his grades or SAT scores.
Cohen also described discussing the Vietnam War with his former boss, who didn't serve because he received a medical deferment for bone spurs. But Cohen says Trump could not provide any medical records and said: "You think I'm stupid, I wasn't going to Vietnam."
Added Cohen, addressing the President thousands of kilometres away: "I find it ironic, President Trump, that you are in Vietnam right now."
The hearing began just before midnight local time in Hanoi. It was not clear whether Trump stayed up late to watch. The President did spend some of the downtime at his hotel before his dinner with Kim watching the coverage of Cohen's prepared testimony, which was released yesterday before his Capitol Hill appearance.
In the written testimony, the President's former lawyer and fixer acknowledged he organised a cover up of potentially damaging allegations of infidelity, which Trump denies, and listened to Trump's racist remarks.
Cohen claimed Trump was told by an associate, Roger Stone, that WikiLeaks had emails damaging to his Democratic rival Hillary Clinton's campaign and planned to release them.
Trump has previously denied knowing anything about Stone's communications with WikiLeaks.
Cohen's testimony on the very day Trump met with Kim is a particularly acute moment of domestic humiliation for a president engaged in foreign diplomacy, but it wasn't the first, said Princeton University history professor Julian Zelizer.
Richard Nixon, Bill Clinton and Ronald Reagan, all endured trouble at home that hampered their foreign policy aims.
Zelizer noted that Clinton ordered air strikes on Iraq in 1998 as an impeachment vote loomed in the House of Representatives. In that case, critics accused Clinton of staging a distraction — a concern that has been raised regarding Trump's moves with North Korea.
"The presidency doesn't stop, even when scandal hits," said Zelizer.
"The one thing that's different is that he's tweeting. In '98 the president said, 'I'm focused on foreign policy,' and he tried to act presidential."
Added Zelizer of Trump: "I think he is going to connect the stories himself."
The President's two-day summit with Kim in Hanoi began with a highly choreographed greeting and photo-op, followed by a dinner, while the serious negotiating was set for tomorrow.
But Cohen shadow's reached across the Pacific, as Trump was asked at the summit by an AP reporter if he had any response to Cohen's testimony.
The President shook his head and scowled.
And a short time later, White House press secretary Sarah Sanders approached the press and said that no reporters would be allowed into the dinner.
That was an abrupt change from the initial plan issued by the White House, which had said that access would be granted to the usual 13-person group of reporters, known as the travelling press pool, who follow the president to every event.
Hours after Trump's day ended, Cohen remained present.
Several White House staffers, including chief of staff Mick Mulvaney, retired to the hotel lobby for a drink. But on the TVs behind them, Cohen's testimony beamed in from thousands of kilometres away.
-AP