Donald Trump behaved like “narcissistic, vengeful autocrat” when he threatened to withhold aid from United Nations (UN) members who criticised the US, a former CIA director has said.

John Brennan said it was “beyond outrageous” that the President had warned of retaliations against nations that voted to condemn his decision to recognise Jerusalem as Israel’s capital.

The resolution to declare Washington’s decision on the city’s status “null and void” was backed by 128 countries at the UN General Assembly, including the UK, despite American ambassador Nikki Haley promising the US would be “taking names” of any nations who supported it.

Only nine countries voted against the motion but 35 abstained. Twenty-one were not present. Experts had predicted at least 150 countries would back the resolution, prompting speculation that some nations had caved in to US threats.

“Trump Admin threat to retaliate against nations that exercise sovereign right in UN to oppose US position on Jerusalem is beyond outrageous,” Mr Brennan tweeted. ”Shows Donald Trump expects blind loyalty and subservience from everyone – qualities usually found in narcissistic, vengeful autocrats.”

Mr Brennan served as CIA director between March 2013 and January 2017, after twice being nominated for the role by Barack Obama. He left after Mr Trump's presidential inauguration ceremony.

Since then, the former intelligence chief has been an outspoken critic of the billionaire Republican leader, describing his ban on travel from certain Islamic countries as “simplistic” and “misguided”.

He also suggested the President “should be ashamed of himself” after a “self-aggrandising” speech he made during a visit to the CIA’s headquarters.

Mr Brennan's post about the President's threat to fellow UN nations, was only his second since he joined Twitter in September.

Mr Trump had earlier defended his stance, telling members of his cabinet: “For all these nations, they take our money and then vote against us. They take hundreds of millions of dollars, even billions of dollars and then they vote against us.

“We’re watching those votes. Let them vote against us. We’ll save a lot. We don’t care.”

Ms Haley wrote to most of the 193 UN member states warning the US could withhold humanitarian aid if they backed the motion. She said the President was taking the matter personally.

The United Nations General Assembly votes 128-9 to declare the United States' Jerusalem capital recognition 'null and void'

The result of the General Assembly vote has little practical impact as it is not legally binding, but is an embarrassment for the US.

Palestinian Authority leader Mahmoud Abbas’s spokesman Nabil Abu Rdainah said the passing of the resolution was a “victory for Palestine”.

But Richard Gowan, a UN expert at the European Council on Foreign Relations think tank, told The Independent the vote is still a “win for Trump in a perverse way”.