ANALYSIS: The optics for a president could not be worse: handing over billions of dollars to the very regime America has been at war against.

Yet, that is the reality facing Donald Trump, who spent years criticising Barack Obama for sending “pallets of cash” to Iran under a 2015 nuclear agreement negotiated by the US, Britain, France, China, Russia and Germany.

The sum Trump has to contemplate – US$24b (NZ$41b), half of it to be paid upfront – would be released in exchange for a memorandum of understanding to end two similarly costly and politically painful months of fighting in the Middle East.

And although the money itself belongs to Iran – the funds are frozen under sanctions – it would be a solution for Trump, who broke his campaign promise and led America to war on February 28.

With no country other than Israel by his side militarily, and without any public or diplomatic backing from traditional allies, the US president promised that overwhelming force would bring a swift victory and prevent Iran from obtaining a nuclear weapon.