Reading out a joint statement, European Union foreign policy chief Federica Mogherini said a "decisive step" after more than a decade of negotiations had been achieved.
Iranian Foreign Minister Mohammad Javad Zarif followed with the same statement in Farsi.
US Secretary of State John Kerry and the top diplomats of Britain, France and Germany also briefly took the stage behind them.
In a tweet, Kerry said there was an agreement "to resolve major issues on nuclear program. Back to work soon on a final deal."
Crucially for the Iranians, economic sanctions related to its nuclear programs are to be rolled back after the UN nuclear agency confirms compliance.