Image copyright Getty Images Image caption Michael Morell (left) said that Chelsea Manning's invitation was "inappropriate"

Ex-acting CIA director Michael Morell has resigned from his post at Harvard over its hiring of Chelsea Manning.

Announcing his resignation as a senior fellow, Mr Morell said he could not be part of an institution "that honours a convicted felon and leaker of classified information".

Harvard later withdrew Ms Manning's invitation as a visiting fellow, but said she remained welcome as a speaker.

She was convicted of espionage in 2013 after leaking secret documents.

In his resignation letter, Mr Morell condemned Harvard's Kennedy School of Government, saying its "decision will assist Ms Manning in her long-standing effort to legitimise the criminal path that she took to prominence", and may serve to encourage other whistleblowers.

He added: "I fully support Ms Manning's rights as a transgender American, including the right to serve our country in the US military."

On her Twitter page, Ms Manning responded to Mr Morell's departure by writing "good", and said the debate around her appointment was "nothing to do with trans rights".

The former Army private also retweeted a review of Mr Morell's 2015 book in which he defended the use of drone strikes and torture techniques against terror suspects.

Mr Morell served in the CIA for 33 years, including three as deputy director under the Obama administration.

He was acting director of the agency for several months in 2011, replacing Leon Panetta when he was named defence secretary, then again from November 2012 to March 2013, when Gen David Petraeus resigned over an extra-marital affair.

Morell retired in 2013 and was named a senior fellow at the Belfer Center for Science and International Affairs at the Kennedy School.

Why did Harvard backtrack?

Ms Manning - who served seven years in a military prison after sharing US government documents with Wikileaks before her sentence was commuted by President Barack Obama - was initially named as a visiting fellow at the Institute of Politics at Harvard Kennedy School on Wednesday.

But after a day of backlash, Harvard released a statement saying that designating her as a visiting fellow had been a "mistake".

The Dean of the Harvard Kennedy School, Douglas Elmendorf, said the university "did not intend to honor [Ms Manning] in any way or to endorse any of her words or deeds, as we do not honor or endorse any fellow".

However, he said, the title is viewed by some people as an honorific, "so we should weigh that consideration when offering invitations".

Mr Elmendorf said the faculty's approach to visiting speakers is "to invite some people who have significantly influenced events in the world, even if they do not share our values".

He apologised to Ms Manning, adding that she was still welcome "to spend a day at the Kennedy School and speak in the Forum".