A retired Navy Seal who planned and oversaw the operation that killed Osama Bin Laden has said Donald Trump’s attacks on the media are the “greatest threat to democracy” he has ever seen.

William H McRaven, who was commander of the secretive Joint Special Operations Command, was delegated responsibility for the dangerous mission targeting the al-Qaeda leader by the CIA in 2011.

He left the military in 2014 after nearly four decades and later became chancellor of the University of Texas. During a recent address to journalism students at the university, the admiral, who has a bachelor's degree in journalism, slammed Mr Trump's characterisation of the press as “the enemy of the American people”, to a crowd gathered at the university’s Moody College of Communication.

“We must challenge this statement and this sentiment that the news media is the enemy of the American people,” Mr McRaven said, according to the Daily Texan. “This sentiment may be the greatest threat to democracy in my lifetime.”

“To be a good leader, you have to be a good communicator,” he added. “As a leader, you have to communicate your intent every chance you get, and if you fail to do that, you will pay the consequences.”

Mr McRaven, who has been described as one of the most experienced terrorist hunters in the US by journalists and biographers, spent years tracking Bin Laden.

Two months before the raid on the terrorist leader's hideout — a high-walled compound in Abbottabad, Pakistan — in May 2011, Mr McRaven personally selected a special unit of Navy SEALs to carry out the mission.

His recent remarks come amid a series of attacks on the media by the president, made mostly on Twitter where he has repeatedly denounced negative stories about his administration as "FAKE NEWS".

In a widely shared tweet last, Mr Trump called the media, naming the New York Times, NBC, ABC, CBS and CNN, “the enemy of the American People!”

Mr Trump repeatedly blasted the media in an aggressive and chaotic news conference last Thursday, where he accused reporters of being dishonest and fake.

He berated a Jewish reporter for asking a question about bomb threats to dozens of Jewish community centres and for expressing concerns that Mr Trump had yet to address anti-Semitic attacks. The president took the question as a personal affront, saying he was not anti-Semitic, even though the reporter never made such an accusation.

Senator John McCain, who served in the US military before moving into politics, has also criticised Mr Trump's stance on the media as dangerous.

In an interview on NBC News, he said attacking the press is “how dictators get started.”

“In other words, [it is] a consolidation of power,” Mr McCain told Meet the Press host Chuck Todd. “When you look at history, the first thing that dictators do is shut down the press. And I’m not saying that President Trump is trying to be a dictator. I’m just saying we need to learn the lessons of history.”

'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence Show all 4 1 /4 'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence 'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence bin-laden1.jpg Troops prepare for their mission in Kathryn Bigelow’s movie Zero Dark Thirty AP 'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence bin-laden2.jpg At The White House, President Barack Obama, Vice President Joe Biden and Secretary of State Hillary Clinton watch the capture of Osama Bin Laden Getty Images 'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence bin-laden-ap.jpg Osama bin Laden was killed by US special forces troops who raided his home in the Pakistani city of Abbottabad AP 'I killed him': US Navy Seal who fired the shot that killed Osama bin Laden breaks his silence bin-laden3.jpg Controversial book by a former Navy Seal who was part of the Bin Laden raid Getty Images

The search for Bin Laden was led by the CIA. Leon Panetta, the agency’s director at the time, delegated the mission to McRaven after then-President Barack Obama authorised him to do so.

In his book titled “Spec Ops,” Mr McRaven noted six key requirements for any successful mission: surprise, speed, security, simplicity, purpose and repetition.