Image copyright Getty/AFP Image caption Watergate reporter Carl Bernstein's story quoted sources saying Mr Trump knew of a 2016 meeting with Russians at Trump Tower

US President Donald Trump is waging a war of words with legendary Watergate reporter Carl Bernstein over a story about his ex-lawyer Michael Cohen.

On Wednesday, the president called Mr Bernstein a "sloppy" and "degenerate fool" who invented stories.

Mr Bernstein fired back, tweeting that he spent his life "bringing the truth to light" and "no taunt" could diminish that commitment.

His story reported Mr Trump knew about a 2016 meeting with Russians.

On Twitter, the president said "CNN is being torn apart from within" over refusing to admit their mistakes, adding that Mr Bernstein "is being laughed at all over the country".

Skip Twitter post by @realDonaldTrump CNN is being torn apart from within based on their being caught in a major lie and refusing to admit the mistake. Sloppy @carlbernstein, a man who lives in the past and thinks like a degenerate fool, making up story after story, is being laughed at all over the country! Fake News — Donald J. Trump (@realDonaldTrump) August 29, 2018 Report

Mr Bernstein, a famed journalist who covered the Watergate scandal during the Nixon presidency, responded saying he stands by his reporting.

Skip Twitter post by @carlbernstein .@realdonaIdtrump- I have spent my life as a journalist bringing the truth to light, through administrations of both parties. No taunt will diminish my commitment to that mission, which is the essential role of a free press. @CNN stands by its story, and I stand by my reporting. — Carl Bernstein (@carlbernstein) August 30, 2018 Report

The story in question had quoted sources as saying that Cohen, the president's former personal lawyer, was ready to testify that Mr Trump was aware of the June 2016 Trump Tower meeting between his son, Donald Trump Jr and Russians who said they had dirt on Hillary Clinton.

Cohen's attorney, Lanny Davis, revealed on Monday that he was CNN's source and has since recanted his statement.

CNN has stood by the story and Mr Bernstein, tweeting at the president: "Make no mistake, Mr President, CNN does not lie."

Skip Twitter post by @CNNPR Make no mistake, Mr. President, CNN does not lie. We report the news. And we report when people in power tell lies. CNN stands by our reporting and our reporters. There may be many fools in this story but @carlbernstein is not one of them. — CNN Communications (@CNNPR) August 29, 2018 Report

On Thursday, Mr Trump called for CNN president Jeff Zucker to be fired over the network's "hatred and extreme bias" towards him.

Skip Twitter post 2 by @realDonaldTrump The hatred and extreme bias of me by @CNN has clouded their thinking and made them unable to function. But actually, as I have always said, this has been going on for a long time. Little Jeff Z has done a terrible job, his ratings suck, & AT&T should fire him to save credibility! — Donald J. Trump (@realDonaldTrump) August 30, 2018 Report

The president continued to lambast US media on Twitter, saying "they only have their hatred and agenda", adding that the media is also responsible for "fake books".

Skip Twitter post 3 by @realDonaldTrump I just cannot state strongly enough how totally dishonest much of the Media is. Truth doesn’t matter to them, they only have their hatred & agenda. This includes fake books, which come out about me all the time, always anonymous sources, and are pure fiction. Enemy of the People! — Donald J. Trump (@realDonaldTrump) August 30, 2018 Report

Mr Trump's clash with Mr Bernstein comes as fellow-Watergate reporter Bob Woodward is set to release a book next month detailing life inside the Trump White House.

What was the CNN story?

Mr Bernstein co-wrote an article that had multiple anonymous sources claiming Cohen said the president was aware of the June 2016 meeting.

That meeting involved Mr Trump's son, his son-in-law Jared Kushner, then-campaign chairman Paul Manafort and an influential Russian lawyer, Natalia Veselnitskaya.

In the 27 July article, CNN stated Mr Davis had declined to comment, and quoted multiple anonymous sources.

The next day, the Washington Post also reported on the claims and cited Mr Davis as a source.

On Monday, however, Mr Davis confirmed to Buzzfeed News that he was CNN's anonymous source and retracted his claims.

"I made a mistake," he said, adding that he should have been clearer to reporters that he could not personally verify the information he gave.

When Mr Davis appeared on CNN with presenter Anderson Cooper, last week, he said "the reporting of the story got mixed up".

CNN stands by its story. Trump supporters argue Mr Davis' statements undermine the original article.

Cohen's case has stoked speculation he could testify against Mr Trump in Robert Mueller's investigation into alleged Russian meddling two years ago in the US elections.

He pleaded guilty to eight counts of tax evasion, bank fraud and campaign finance crimes last week.