Former FBI Director James Comey is blasting President Donald Trump as unethical and "untethered to truth" and his leadership of the country as "ego-driven and about personal loyalty." File picture: Carolyn Kaster/AP

Washington - US President Donald Trump attacked James Comey on Twitter Friday, saying the former FBI director is "a proven LEAKER & LIAR" and "should be prosecuted" for leaking classified information.

The news comes shortly after the release of excerpts of Comey's new book, set to be released Tuesday, which paints a devastating portrait of the president as a congenital liar and an unethical leader.

"Virtually everyone in Washington thought he should be fired for the terrible job he did - until he was, in fact, fired. He leaked CLASSIFIED information, for which he should be prosecuted. He lied to Congress under OATH," Trump wrote in an early morning tweet.

"He is a weak and untruthful slime ball who was, as time has proven, a terrible Director of the FBI. His handling of the Crooked Hillary Clinton case, and the events surrounding it, will go down as one of the worst "botch jobs" of history. It was my great honor to fire James Comey!" Trump continued on Twitter.

The excerpts of Comey's book, "A Higher Loyalty: Truth, Lies and Leadership," describe Trump as someone who is "untethered to truth," "ego-driven" and "demanding of personal loyalty."

It is Comey's first extensive account of his encounters with Trump since he testified before Congress last year.

Among the revelations is that Trump used a meeting with Comey to deny unconfirmed allegations contained in a dossier about his alleged behaviour with prostitutes in Moscow in 2013.

The allegations in the dossier, including that Russians had filmed Trump interacting with prostitutes, were compiled by British intelligence officer Christopher Steele, but never verified.

Comey's book recounts for the first time that he and Trump discussed the accusations.

According to Comey's account, the president-elect "strongly denied the allegations, asking - rhetorically, I assumed - whether he seemed like a guy who needed the service of prostitutes."

Trump then worked over the next several months to win Comey's loyalty. When Trump first asked for his loyalty at a White House dinner, Comey writes that he responded with silence.

Trump fired Comey in May, a move that led to the Justice Department special counsel's Russia investigation.