President Donald Trump stops CNN's Jim Acosta while taking questions during a news conference following Tuesday's midterm congressional elections at the White House in Washington, November 7, 2018.

President Donald Trump on Friday launched his first Twitter attacks against Michael Cohen since his former longtime lawyer and fixer provided riveting testimony about their relationship before Congress.

After returning from his second summit with the North Korean dictator Kim Jong Un in Vietnam — which was cut short and failed to produce any new agreements — Trump tore into Cohen in a Friday morning tweet storm, accusing him of "going rogue" and committing "perjury on a scale not seen before."

Cohen, 52, pleaded guilty last year to crimes including campaign finance violations and tax evasion, as well as lying to Congress in prior testimony in 2017. He cut agreements with federal prosecutors in New York and with special counsel Robert Mueller, who is investigating Russian meddling and possible collusion with Trump's campaign in the 2016 election.

Trump had responded generally to Cohen's testimony during a television interview while in Hanoi for the summit with Kim. The president claimed Cohen "lied a lot" during the hearing, but added: "It's very interesting because he didn't lie about one thing: He said no collusion with Russia."

Trump, who has no public events scheduled for Friday, amped up his rhetoric in a five-tweet salvo against Cohen.

"Wow, just revealed that Michael Cohen wrote a 'love letter to Trump' manuscript for a new book that he was pushing," Trump claimed. "Book is exact opposite of his fake testimony, which now is a lie!"

The president claimed the book was "written and submitted long after Charlottesville and Helsinki, his phony reasons for going rogue." Trump was referencing Cohen's claim in the hearing that the president's conduct in Helsinki and Charlottesville, Virginia, led the fixer to reconsider his loyalty to Trump.

In 2017, Trump said "there were very fine people, on both sides" of a violent white supremacist rally in Charlottesville, in which one counterprotester was killed. In Helsinki, Trump appeared to accept as genuine Russian President Vladimir Putin's denial that the Kremlin meddled in the 2016 election — a position that broke with U.S. intelligence.

Trump appeared to be referring to Cohen's book deal with Hachette Book Group that was reportedly in the works in early 2018, but fell apart after FBI agents raided Cohen's properties in April. Cohen said Wednesday that that deal was worth about $750,000, for a book to be titled "Trump Revolution: From the Tower to the White House, Understanding Donald J. Trump." He testified that he turned down the deal.

The White House did not confirm to CNBC whether Trump was referencing that book deal specifically.

Trump called on Congress to "demand the transcript" of that book. "Your heads will spin when you see the lies, misrepresentations and contradictions against his Thursday testimony. Like a different person! He is totally discredited," Trump wrote.