The details of final deal agreed by Iran and six world powers in Vienna show tough compromises on both sides with the Iranian and US government in particular under pressure to appease domestic hardliners.

Iranian Foreign Minister Mohammad Javad Zarif said the agreement was “not perfect for anybody” but, as the new UN resolution is drawn up, the negotiators will be relieved that a consensus was finally reached after many years of setbacks and false starts.

Perhaps the biggest concession made by Barack Obama was Iran’s power to challenge UN requests to access its military sites if there are suspicions of nuclear activity.

The UN will not have free access to any site across Iran, but then no country in the world would submit to such a request.

At the same time, Iran conceded that the P5+1 will have the ability to reinstate sanctions, known as the “snap back” within 65 days if Tehran is ruled to have broken the conditions of the agreement.

Conservatives in both Iran and the US – along with Israel – will continue their attempts to scupper the deal, arguing that their side has conceded too much.

There is no such thing as a good deal or a bad deal for both sides but the result is a victory for every negotiator determined clinch a deal.