A former acting director of the CIA has endorsed Hillary Clinton and said Donald Trump may not only be unqualified for the presidency but also a “threat to national security”.

In a scathing attack on the Republican candidate, Michael Morell, who spent 33 years at the agency and twice served as its acting director, suggested that he had been co-opted by Russian President Vladimir Putin.

“I am neither a registered Democrat nor a registered Republican. In my 40 years of voting, I have pulled the lever for candidates of both parties. As a government official, I have always been silent about my preference for president,” he wrote in an article for the New York Times.

Michael Morell said Mr Trump was a threat to national security (AP)

“No longer. On November 8, I will vote for Hillary Clinton. Between now and then, I will do everything I can to ensure that she is elected as our 45th president.”

Mr Morell said he had been led to his decision by two factors. One was what he termed Ms Clinton’s qualification for the job. He said she was ready to be the nation’s commander-in-chief and would keep the US safe.

The second was his belief that Mr Trump was not only unqualified for the job but that he “may well pose a threat to our national security”.

“In sharp contrast to Mrs Clinton, Mr Trump has no experience on national security. Even more important, the character traits he has exhibited during the primary season suggest he would be a poor, even dangerous, commander in chief,” he added.

He claimed that in contrast to Ms Clinton, Mr Trump did not possess either the experience or the temperament required for president. He even suggested Mr Trump had allowed his vanity to open him to exploitation by Mr Putin.

“Mr Putin played upon Mr Trump’s vulnerabilities by complimenting him. He responded just as Mr Putin had calculated,” he said. “In the intelligence business, we would say that Mr Putin had recruited Mr Trump as an unwitting agent of the Russian Federation.”

Mr Morell said Ms Clinton was more than experienced for the White House job (Getty)

Mr Trump placed himself at the centre of raging controversy after the publication of more than 20,000 emails from the Democratic National Committee by Wikileaks. US media has said that intelligence officials believe the emails, one of which exposed a plot by party officials to try and smear Bernie Sanders, were hacked by the Russian government.

In comments that some observers suggested were treasonous, Mr Trump then urged Russia to hack the remainder of Ms Clinton’s emails to discover those that had been deleted. He later claimed that he had merely been joking. Both Mr Trump and the Russian government said they had nothing to do with the hacking.

He said he believed that Mr Trump had further weakened security by his call to stop Muslims entering the US. “This position, which so clearly contradicts the foundational values of our nation, plays into the hands of the jihadist narrative that our fight against terrorism is a war between religions,” he said.

Mr Morell is the latest in a series of high-profile figures to suggest Mr Trump does not have the correct experience or outlook for the White House. Earlier this week, President Barack Obama said he was “woefully” unfit for the job.