In a dramatic breakthrough, Iran and the P5+1 — the United States, China, Russia, France, United Kingdom and Germany — reached on Tuesday a final, comprehensive deal to curb Tehran’s nuclear program while gradually easing international sanctions. Despite criticism of it, the deal is a major historic landmark that could have profound geopolitical and economic consequences in the Middle East and beyond.

The importance, complexity and tough nature of the entire 18-month talks process is underlined by the fact that John Kerry stayed for almost 3 weeks in Vienna to seal the final deal, making his engagement the longest negotiation at a single site by a U.S. secretary of state since the Second World War some seven decades ago. This investment of effort underlines that the accord is perceived by the administration as a very significant foreign policy victory.

This is not only because, as President Barack Obama has said, a final deal will “take a big piece of business off the table and begin a long process in which the relationship not just between Iran and [the United States] but the relationship between Iran and the world, and the region, begins to change.” In addition, a lasting settlement will constitute an important win for long-standing efforts to combat nuclear non-proliferation. And this at a crucial time when, according to the International Atomic Energy Agency, over 40 countries have expressed interest in joining the ‘club’ of 30 states with nuclear energy.

For Iranian President Hassan Rouhani, the final deal is also a major success and a key stepping stone toward revitalizing the Iranian economy which has been hit hard by years of international sanctions. It will also give him the potential political opportunity to bolster reformists, many of whom are key supporters, in advance of next year’s Iranian parliamentary elections.

For Obama, the comprehensive settlement constitutes a major part of his foreign policy legacy as president — one of the key pillars of which is enhanced global nuclear security. As well as inter-state nuclear breakthroughs, such as the 2010 New Strategic Arms Reductions Treaty with Russia, the administration has created the Nuclear Security Summit (NSS) process to counter nuclear terrorism which the president has described as the “most immediate and extreme threat to global security.”

Since 2010, three NSS summits have been held, with a fourth in 2016 in Washington. These events have set in train a very ambitious body of international work to “secure all vulnerable nuclear material around the world” by the end of Obama’s presidency.

Now that a final deal is in place, there will be growing optimism about a wider rapprochement in U.S.-Iranian ties, including in pursuing common objectives in the Middle East such as the fight against so-called Islamic State. Highlighting this, Obama has reiterated that the West and Tehran now have the best opportunity “in decades,” specifically since the revolution in 1979, to move relations forward.

Under the terms of the deal, Iran will receive phased relief from EU, U.S. and UN sanctions. This is a major issue for Tehran because, for instance, sanctions have approximately halved the country’s oil exports to just over 1 million barrels per day since 2012, which has helped cripple the economy. Iran is the holder of the world’s fourth-largest oil reserves, and the second biggest natural gas stockpile.

The agreement will be greeted with alarm in several quarters, both in Washington and Tehran and internationally too, and could yet unravel. Internationally, the deal will accelerate unease in some Arab states, including Saudi Arabia, but it is Israeli Prime Minister Benjamin Netanyahu who remains the fiercest public critic and has issued a warning that the accord will “inevitably lead to a nuclear war.”

To be sure, no lasting settlement that Iran would ever be likely to agree to will completely eliminate its ability to build a nuclear bomb. In testimony last year, Kerry told Congress that it would, in theory, currently take Tehran around “two months” to produce sufficient nuclear material for such a weapon.

However, buttressed by greater international monitoring and oversight of Iran’s program, the P5+1 believe that they have significantly lengthened this so-called ‘break-out period’ to at least 12 months. This is a very sensitive issue with many conservatives in Tehran, including Supreme Leader Ayatollah Ali Khamenei.

This underlines the fact that, within Iran and the United States, opposition to a final deal is concentrated largely (but by no means exclusively rests) amongst conservatives, including the Republican Party which controls Congress. And, it is the American federal legislature where the deal faces the most obvious and immediate challenge, with a 60 day review period soon underway with final votes probably not until the autumn.

Already, many Republicans and some Democrats have attacked the agreement, including Senate Majority Leader Mitch McConnell and House Speaker John Boehner, as a misguided diplomatic move. However, the administration remains confident that the deal will not be permanently blocked because, under the terms of congressional oversight of the deal, it will require a two thirds majority of the House and Senate to override a presidential veto.

Given the vehemence of this opposition, however, some critics are unlikely to reconcile themselves to the final deal, even if it is approved by Congress. The agreement could thus easily become a focal point for Republican (and possibly some Democratic) attacks in the 2016 U.S. presidential election, leaving open the possibility that Obama’s successor will revisit this issue.

This political discontent in the United States may only embolden Netanyahu. Especially with the latter’s new electoral mandate, Israel will probably reserve the right to take unilateral military action against Iran’s nuclear facilities.

Taken overall, the final, comprehensive nuclear deal is a historic landmark that opens a new chapter in Iran’s relations with the United States, and wider West. However, domestic and international critics will now rally against the agreement, and it will face an early and significant hurdle this autumn in Congress.