Iran’s foreign minister called the agreement “historic”. The EU negotiator hailed it as “a sign of hope”.
The deal reportedly gives UN nuclear inspectors extensive but not automatic access to sites within Iran.
Negotiations between Iran and six world powers – the US, UK, France, China and Russia plus Germany – began in 2006.
The so-called P5+1 want Iran to scale back its sensitive nuclear activities to ensure that it cannot build a nuclear weapon.
Iran, which wants crippling international sanctions lifted, has always insisted that its nuclear work is peaceful.
EU foreign policy chief Federica Mogherini said the deal was “a sign of hope for the entire world”.
“It is a decision that can open the way to a new chapter in international relations,” she said, ahead of a final meeting between negotiators in Vienna.