Republican leaders and former security officials discussed Republican presidential nominee Donald Trump's national security qualifications on political shows on Aug. 7. (Bastien Inzaurralde/The Washington Post)

Former CIA director Michael Morell endorsed Democratic presidential nominee Hillary Clinton and blasted GOP rival Donald Trump, accusing him of becoming an unwitting agent of Russian President Vladimir Putin in an op-ed on Friday.

Morell wrote that while he is neither a registered Democrat nor a Republican and has never made his preference for president public, he chose to publicly declare his support for Clinton in this election.

"First, Mrs. Clinton is highly qualified to be commander in chief. I trust she will deliver on the most important duty of a president — keeping our nation safe," Morell wrote in the op-ed published in the New York Times. "Second, Donald J. Trump is not only unqualified for the job, but he may well pose a threat to our national security."

Morell served as deputy director of the CIA and acting director of the CIA under President Obama. He served as a senior officer at the agency during the George W. Bush administration.

Morell detailed his experience working with Clinton when she served as secretary of state. He credited her with being an early advocate of the raid that killed Osama bin Laden and described her as "prepared, detail-oriented, thoughtful, inquisitive and willing to change her mind if presented with a compelling argument."

"I never saw her bring politics into the Situation Room," Morell wrote. "In fact, I saw the opposite. When some wanted to delay the Bin Laden raid by one day because the White House Correspondents Dinner might be disrupted, she said, “Screw the White House Correspondents Dinner.”

Russian President Vladimir Putin calls presumptive Republican presidential nominee Donald Trump "a flamboyant person" and welcomes his calls to restore US-Russia relations. (Reuters)

After retiring from the CIA in 2013, Morell joined Beacon Global Strategies, a firm co-founded by former top Clinton aide Philippe Reines.

He has testified in congressional hearings about the September 2012 attacks in Benghazi, Libya, which have become central to GOP arguments against Clinton, who led the State Department during the fatal attacks. He has been a frequent defender of Obama, Clinton and the agency's handling of the attacks, which took the lives of a U.S. ambassador and three other Americans, and the aftermath. Morell is widely viewed as being in line for a senior national security position in a Clinton administration.

Morell's criticism of Trump was as strong as his praise for Clinton. He noted that Putin is a trained intelligence officer, and he suggested that the Russian leader has been using Trump's personality for his own gain. In the primaries, Morell said, Putin "played upon Mr. Trump's vulnerabilities" by complimenting him.

Donald Trump seemed to praise Saddam Hussein at a July 5 rally, but it's not the first time the presumptive Republican presidential nominee said nice things about authoritarian leaders. (Peter Stevenson/The Washington Post)

Among the traits Morell said would make Trump a "danger" to national security: "his obvious need for self-aggrandizement, his overreaction to perceived slights, his tendency to make decisions based on intuition, his refusal to change his views based on new information, his routine carelessness with the facts, his unwillingness to listen to others and his lack of respect for the rule of law."

Morell said that Trump responded to the Russian leader's flattery "just as Mr. Putin had calculated," including praising Putin's leadership skills and ignoring his jailing and suspected killing of journalists and political opponents. Trump has taken policy positions "consistent with Russian, not American interests," Morell said, and has endorsed Russian espionage against the United States.

"In the intelligence business, we would say that Mr. Putin had recruited Mr. Trump as an unwitting agent of the Russian Federation," Morell said.

In response to Morell's comments, Trump said in a statement Friday that Clinton was "unfit to serve as president" and that Morell's statement was an effort to shift attention away from the Democratic nominee's bad judgment.

“Hillary Clinton and President Obama bear the direct responsibility of destabilizing the Middle East, having let ISIS take firm hold in Iraq, Libya and Syria, not to mention their allowing Americans to be slaughtered at Benghazi," Trump said. "Clinton’s home email server that she lied to the American people about was a profound national security risk, and it should come as no surprise that her campaign would push out another Obama-Clinton pawn (who is not independent) to try to change the subject."

Trump also raised the issue of a $400 million U.S. transfer of cash to the Iranian government, which Trump and other critics have claimed was a ransom payment for the release of Americans imprisoned in Iran.

The Obama administration strongly denied that the money was ransom and said it was a payment to settle a decades-old claim over Iranian funds frozen by the United States, plus interest. The payment coincided with the release of four Americans from Iranian prisons, including Washington Post reporter Jason Rezaian, and the implementation of an agreement with Iran to curb its nuclear program.

The administration announced, at the time the hostages were released in January, that it had agreed to the claim settlement, which involved pre-revolutionary Iranian payment for the purchase of U.S. arms that were never delivered.

Greg Miller contributed to this report.