– Iran and the world powers said Thursday that they had reached a surprisingly specific and comprehensive general understanding about the next steps in limiting Tehran's nuclear program, though Western officials said many details needed to be resolved before a final agreement in June.

Both Germany's foreign office and President Hassan Rowhani of Iran said that the major parameters of a framework for a final accord had been reached, after eight days of intense debate between Secretary of State John Kerry and his Iranian counterpart, Mohammad Javad Zarif.

There was no mistaking the upbeat mood surrounding the announcement. "We have stopped a cycle that is not in the interest of anybody," an exuberant Zarif said at a news conference after the announcement.

Speaking from the White House, President Obama called it a "historic understanding with Iran" and made a strong case for the deal. He said that it "cuts off every pathway" for Iran to develop a nuclear weapon and that it establishes the most intrusive inspections system in history. "If Iran cheats," he said, "the world will know it."

Even two of the most skeptical experts on the negotiations — Gary Samore and Olli Heinonen of the Kennedy School of Government at Harvard and members of a group called United Against Nuclear Iran — said they were impressed with the depth of detail.

Samore, who was Obama's top adviser on weapons of mass destruction in his first term as president, said in an e-mail that there is "much detail to be negotiated but I think it's enough to be called a political framework." Just a day ago, that appeared in doubt.

Heinonen, the former chief inspector of the International Atomic Energy Agency (IAEA), said "it appears to be a fairly comprehensive deal with most important parameters." But he cautioned that "Iran maintains enrichment capacity, which will be beyond its near-term needs."

According to European officials, roughly 5,000 centrifuges will remain spinning enriched uranium at the main nuclear site at Natanz, about half the number currently running. The giant underground enrichment site at Fordo — which Israeli and some U.S. officials fear is impervious to bombing — will be partly converted to advanced nuclear research and the production of medical isotopes. Foreign scientists will be present. There will be no fissile material present that could be used to make a bomb.

A major reactor at Arak, which officials feared could produce plutonium, would operate on a limited basis that would not provide enough fuel for a bomb.

In return, the European Union and the United States would begin to lift sanctions, as Iran complied. Zarif said that essentially all sanctions would be lifted after the final agreement is signed.

The announcement was made at a university in Lausanne, with Kerry standing with his fellow foreign ministers. But the first statement came from the European Union's foreign policy chief, Federica Mogherini, and Zarif. "Today we have taken a decisive step," Mogherini said. "We have reached solutions on key parameters of a comprehensive political solution."

In his statement, Obama invited a "robust" debate on the agreement, but argued that the detail announced — far more comprehensive than had been expected — should persuade Congress not just to hold off on additional sanctions on Iran but to approve the agreement that emerges June 30, assuming the final accord can be reached.

Western diplomats were quick to warn that there was more to do. "The fine detail of any deal will be very important," said Britain's foreign secretary, Philip Hammond, "in particular, specifics of oversight measures and mechanisms for handling U.N. Security Council resolutions."

For example, it was unclear how and whether Iran would be compelled to answer the IAEA's outstanding questions about "possible military dimensions" of Iran's program in the past.

Clearly one area where the Obama administration will run into criticism in Congress and elsewhere is the duration of the agreement. Iran faces sharp limits for the first 10 years, and during that time the United States would be able to say that the country remains a year away from being able to produce one weapon's worth of fuel — Obama's objective.

But it cannot claim that in years 10 to 15, when Iran would be permitted to gradually increase production. And after year 15 the agreement largely expires — meaning that Iran would be able to produce as much material as it wishes, like Japan or Brazil.

It would remain under the inspection requirements it agreed to, and inspectors would still be able to roam the country. But there would be no limits on production — meaning that if Iran wanted to set up the 190,000 centrifuges that Ayatollah Ali Khamenei talked about last summer, it would be able to do so.

That expiration date on the agreement is essentially a bet that in 15 years Iran's government is fundamentally different than it is today.