Iran and the United States and its negotiating partners finally reached agreement Tuesday on a deal that would curb Iran's nuclear program in exchange for sanctions relief -- setting up a looming showdown between President Obama and Congress, where lawmakers could take issue with several provisions, including one giving Iran leverage over inspections. 

Speaking from the White House, Obama claimed the deal meets "every single one of the bottom lines" from a tentative agreement struck earlier this year. 

"Every pathway to a nuclear weapon is cut off," Obama said, claiming it provides for extensive inspections. "This deal is not built on trust. It is built on verification." 

Yet that very issue could be the primary sticking point going forward. 

While some members of Congress had urged comprehensive inspections of Iran's nuclear sites, the deal in hand gives Iran much leverage over that process. The agreement requires international inspectors to ask Iran's permission first, after which Iran has 14 days to decide whether to grant it. If not, the same group of nations that struck the deal would have another 10 days to make their decision about what to do next. While the international group may have final say, the set-up essentially gives Iran 24 days to drag out the process, though officials say this is not enough time to hide all evidence of illicit conduct. 

More On This...

Already, some on Capitol Hill were warning about the implications of the deal; lawmakers will have 60 days to review and vote on the agreement. Senate Majority Leader Mitch McConnell, R-Ky., said the deal "appears to further the flawed elements of April's interim agreement." 

But Obama said it would be "irresponsible" to walk away and vowed to veto any attempt to crush the agreement. 

"No deal means a greater chance of more war in the Middle East," Obama said. 

Diplomats struck the deal after the latest 18-day round of intense and often fractious negotiations in Vienna, Austria blew through several self-imposed deadlines. A final meeting between the foreign ministers of Iran, the United States, Britain, China, France, Germany and Russia was held Tuesday morning.

Iranian Foreign Minister Javad Zarif described the accord as "a historic moment" as he attended the final session.

"We are reaching an agreement that is not perfect for anybody, but it is what we could accomplish," Zarif continued, "and it is an important achievement for all of us. Today could have been the end of hope on this issue. But now we are starting a new chapter of hope."

Federica Mogherini, the European Union foreign policy chief, called it "a sign of hope for the entire world."

The accord is meant to keep Iran from producing enough material for a nuclear weapon for at least 10 years and will impose new provisions for inspections of Iranian facilities, including military sites.

Diplomats said Iran agreed to the continuation of a United Nations arms embargo on the country for up to five more years, though it could end earlier if the International Atomic Energy Agency (IAEA) definitively clears Iran of any current work on nuclear weapons. A similar condition was put on U.N. restrictions on the transfer of ballistic missile technology to Tehran, which could last for up to eight more years.

According to officials, Iran also had agreed to a so-called "snapback" provision, under which sanctions could be reinstated if it violates the agreement.  

Washington had sought to maintain the ban on Iran importing and exporting weapons, concerned that an Islamic theocracy flush with cash from the nuclear deal would expand its military assistance for Syrian President Bashar Assad's government, Yemen's Houthi rebels, the Lebanese militant group Hezbollah and other forces opposing America's Mideast allies such as Saudi Arabia and Israel.

Iranian leaders insisted the embargo had to end as their forces combat regional scourges such as ISIS. And they got some support from China and particularly Russia, which wants to expand military cooperation and arms sales to Tehran, including the long-delayed transfer of S-300 advanced air defense systems -- a move long opposed by the United States.

The last major sticking point -- which could still cause problems on Capitol Hill -- appeared to be whether international weapons inspectors would be given access to Iranian nuclear sites. The deal includes a compromise between Washington and Tehran that would allow U.N. inspectors to press for visits to Iranian military sites as part of their monitoring duties. However, access at will to any site would not necessarily be granted and even if so, could be delayed, a condition that critics of the deal are sure to seize on as possibly giving Tehran time to cover any sign of non-compliance with its commitments.

Under the deal, Tehran would have the right to challenge the U.N. request and an arbitration board composed of Iran and the six world powers that negotiated with it would have to decide on the issue. Such an arrangement would still be a notable departure from assertions by top Iranian officials, including supreme leader Ayatollah Ali Khamenei, that their country would never allow the IAEA into such sites. Iran has argued that such visits by the IAEA would be a cover for spying on its military secrets.

The IAEA also wants the access to complete its long-stymied investigation of past weapons work by Iran, and the U.S. says Iranian cooperation is needed for all economic sanctions to be lifted. IAEA chief Yukiya Amano said Tuesday his agency and Iran had signed a "roadmap" to resolve outstanding concerns.

"This is a significant step forward towards clarifying outstanding issues regarding Iran’s nuclear program," Amano said in a statement released Tuesday. 

The economic benefits for Iran are potentially massive. It stands to receive more than $100 billion in assets frozen overseas, and an end to a European oil embargo and various financial restrictions on Iranian banks.

The overall nuclear deal comes after nearly a decade of international, intercontinental diplomacy that until recently was defined by failure. Breaks in the talks sometimes lasted for months, and Iran's nascent nuclear program expanded into one that Western intelligence agencies saw as only a couple of months away from weapons capacity. The U.S. and Israel both threatened possible military responses.

The United States joined the negotiations in 2008, and U.S. and Iranian officials met together secretly four years later in Oman to see if diplomatic progress was possible. But the process remained essentially stalemated until summer 2013, when Hassan Rouhani was elected president and declared his country ready for serious compromise.

More secret U.S.-Iranian discussions followed, culminating in a face-to-face meeting between Secretary of State John Kerry and Iranian Foreign Minister Mohammad Javad Zarif at the United Nations in September 2013 and a telephone conversation between Rouhani and Obama. That conversation marked the two countries' highest diplomatic exchange since Iran's 1979 Islamic Revolution and the ensuing hostage crisis at the American embassy in Tehran.

Kerry and Zarif took the lead in the negotiations. Two months later, in Geneva, Iran and the six powers announced an interim agreement that temporarily curbed Tehran's nuclear program and unfroze some Iranian assets while setting the stage for Tuesday's comprehensive accord.

Protracted negotiations still lie ahead to put the agreement into practice and deep suspicion reigns on all sides about violations that could unravel the accord. And spoilers abound.

In the United States, Congress has a 60-day review period during which Obama cannot make good on any concessions to the Iranians. U.S. lawmakers could hold a vote of disapproval and take further action. If Obama vetoes, Congress would need to muster a two-thirds majority to override. 

Iranian hardliners oppose dismantling a nuclear program the country has spent hundreds of billions of dollars developing. Khamenei, while supportive of his negotiators thus far, has issued a series of defiant red lines that may be impossible to reconcile in a deal with the West.

And further afield, Israel will strongly oppose the outcome. It sees the acceptance of extensive Iranian nuclear infrastructure and continued nuclear activity as a mortal threat, and has warned that it could take military action on its own, if necessary.

The deal is a "bad mistake of historic proportions," Israeli Prime Minister Benjamin Netanyahu said Tuesday, adding that it would enable Iran to "continue to pursue its aggression and terror in the region."

Sunni Arab rivals of Shiite Iran are none too happy, either, with Saudi Arabia in particularly issuing veiled threats to develop its own nuclear program.

The Associated Press contributed to this report.