Ban "warmly welcomes" the preliminary accord under which Iran agreed to limit its uranium enrichment in return for sanctions relief, said the UN spokesman Martin Nesirky.
Ban said the accord "could turn out to be the beginnings of a historic agreement for the peoples and nations of the Middle East region and beyond."
Iran struck the deal with the United States, Russia, China, Britain, France and Germany, and Ban said all sides must work on "creating mutual confidence and allowing continued negotiations to extend the scope of this initial agreement."
The Elders, a group of former world leaders, also welcomed the accord, but called for swift followup measures to make sure it is carried out.
"We are all aware of the risks involved," said Jimmy Carter, former US president who clashed with Iran during his term of office.
"But I am convinced that, after 35 years of animosity and distrust, there is an historic opportunity to rebuild relations with the government and people of Iran on solid foundations of mutual respect," Carter said in a statement released by his group.