Under the deal, sanctions imposed by the United States, European Union and United Nations would be lifted in return for Iran agreeing long-term curbs on a nuclear program that the West has suspected was aimed at creating a nuclear bomb.
Reaching a deal is a major policy victory for both U.S. President Barack Obama and Iran's President Hassan Rouhani, a pragmatist elected two years ago on a vow to reduce Iran's diplomatic isolation.
Both men face scepticism from powerful hardliners at home after decades of enmity between countries that referred to each other as "the Great Satan" and a member of the "axis of evil".
Final talks in Vienna involved nearly three weeks of intense round-the-clock negotiations between U.S. Secretary of State John Kerry and Iran's Foreign Minister Mohammad Javad Zarif.
Western diplomats said under the final agreement, Iran had accepted a "snapback" mechanism, under which some sanctions could be reinstated in 65 days if it violated the deal. A U.N. weapons embargo would remain in place for five years and a ban on buying missile technology would remain for eight years.
"All the hard work has paid off and we sealed a deal. God bless our people," one Iranian diplomat told Reuters on condition of anonymity.
But hostility to the agreement from Washington's closest ally in the Middle East was immediate.
"This deal is a historic surrender by the West to the axis of evil headed by Iran," Israeli Deputy Foreign Minister Tzipi Hotovely said in a message on Twitter. "Israel will act with all means to try and stop the agreement being ratified."
The foreign ministers of Iran and the six powers will meet at 0830 GMT (4.30 a.m. ET) at the United Nations center in Vienna and a news conference will follow, a spokeswoman for the European Union said on Tuesday.
Iran's Foreign Minister, Mohammad Javad Zarif, and EU's Foreign Policy Chief Federica Mogherini are expected to read a joint statement, diplomats said.
A deal will still face scrutiny by the U.S. Congress, controlled by opposition Republicans who are skeptical of the Obama administration's overtures to a country that has been an enemy since Iranian revolutionaries stormed the U.S. embassy in Tehran in 1979.
U.S. allies in the region, particularly Israel and Saudi Arabia, are also worried about an agreement that would benefit Iran.
Tehran does not recognize Israel and supports its enemies. Arab states ruled by Sunni Muslims, particularly Saudi Arabia believe Iran supports their foes in wars in Syria, Yemen and elsewhere.
But there is also strong reason for the United States to improve its relations with Iran, as the two countries face a common foe in Islamic State, the Sunni Muslim militant group that has seized swathes of Syria and Iraq.
For Iran, the end of sanctions could bring a rapid economic boom by lifting restrictions that have drastically cut its oil exports and hurt its imports. The prospect of a deal has helped push down global oil prices because of the possibility that Iranian supply could return to the market.