President Obama says the U.S. has agreed to provide Iran with "modest relief" from sanctions as part of a deal on the country's nuclear program. (Associated Press)

Iran and six major powers agreed early Sunday on a historic deal that freezes key parts of Iran’s nuclear program in exchange for temporary relief on some economic sanctions.

The agreement, sealed at a 3 a.m. signing ceremony in Geneva’s Palace of Nations, requires Iran to halt or scale back parts of its nuclear infrastructure, the first such pause in more than a decade.

Iranian Foreign Minister Mohammad Javad Zarif hailed the deal, which was reached after four days of hard bargaining, including an eleventh-hour intervention by Secretary of State John F. Kerry and foreign ministers from Europe, Russia and China.

“It is important that we all of us see the opportunity to end an unnecessary crisis and open new horizons based on respect, based on the rights of the Iranian people and removing any doubts about the exclusively peaceful nature of Iran’s nuclear program,” Zarif told reporters in English. “This is a process of attempting to restore confidence.”

The deal, intended as a first step toward a more comprehensive nuclear pact to be completed in six months, freezes or reverses progress at all of Iran’s major nuclear facilities, according to Western officials familiar with the details. It halts the installation of new centrifuges used to enrich uranium and caps the amount and type of enriched uranium that Iran is allowed to produce.

Iran also agreed to halt work on key components of a heavy-water reactor that could someday provide Iran with a source of plutonium. In addition, Iran accepted a dramatic increase in oversight, including daily monitoring by international nuclear inspectors, the officials said.

(Nuclear pact’s fine print: A temporary halt in advances)

The concessions not only halt Iran’s nuclear advances but also make it virtually impossible for Tehran to build a nuclear weapon without being detected, the officials said. In return, Iran will receive modest relief of trade sanctions and access to some of its frozen currency accounts overseas, concessions said to be valued at less than $7 billion over the six-month term of the deal. The sanctions would be reinstated if Iran violates the agreement’s terms.

Not long after the accord was reached, Iran’s President Hassan Rouhani said the deal recognizes Tehran’s “right” to maintain an enrichment program.

Rouhani said, “Let anyone make his own reading, but this right is clearly stated in the text of the agreement that Iran can continue its enrichment, and I announce to our people that our enrichment activities will continue as before.”

But Kerry said in response on Sunday that the deal does not recognize a “right to enrich.”

“There is no inherent right to enrich,” Kerry said on ABC’s “This Week.” “And everywhere in this particular agreement it states that they could only do that by mutual agreement, and nothing is agreed on until everything is agreed on.”

In an address from the White House after the deal was announced, President Obama praised the negotiators’ work. “Today, that diplomacy opened up a new path toward a world that is more secure — a future in which we can verify that Iran’s nuclear program is peaceful and that it cannot build a nuclear weapon,” he said. “While today’s announcement is just a first step, it achieves a great deal. For the first time in nearly a decade, we have halted the progress of the Iranian nuclear program, and key parts of the program will be rolled back.”

The agreement is a long-sought victory for the Obama administration, which from its earliest days made the Iranian nuclear program one of its top foreign policy priorities. The administration, helped by its overseas allies as well as Congress, achieved unprecedented success in imposing harsh economic sanctions that cut Iran’s oil exports in half and decimated the country’s currency. It was hoping to quickly finalize an agreement in the face of threats by Congress to impose additional economic sanctions on Iran.

A number of Congress members expressed skepticism about the deal Sunday, including an influential member of the president’s own party, Sen. Robert Menendez (D-N.J.), chairman of the Senate Foreign Relations Committee. “In my view, this agreement did not proportionately reduce Iran’s nuclear program for the relief it is receiving,” Menendez said in a statement. “Given Iran’s history of duplicity, it will demand ongoing, on the ground verification.”

But Menendez also suggested that Congress would not impose new sanctions during the six-month interim agreement period.

“I expect that the forthcoming sanctions legislation to be considered by the Senate will provide for a six month window to reach a final agreement before imposing new sanctions on Iran, but will at the same time be immediately available should the talks falter or Iran fail to implement or breach the interim agreement,” his statement sad.

Speaking in the predawn hours after the announcement, Kerry said the goal of the talks was to “require Iran to prove the peaceful nature of its program and ensure that it cannot acquire a nuclear weapon.”

He called the agreement a “serious first step” toward resolving world doubts about Iran’s program. Kerry then addressed Israeli concerns directly. “It will make our partners in the region safer. It will make our ally Israel safer.”

He said it is too soon to tell whether the agreement can help turn the page from more than three decades of animosity and suspicion between the United States and Iran. “This is potentially a significant moment,” he said, “but I’m not going to stand here in some triumphal moment and suggest to you that this is an end unto itself. It is not.”

Rep. Adam Smith (D-Wash.), the ranking Democrat on the House Armed Services Committee, called the deal “a positive step” and added that it is “vital that we prevent Iran from obtaining a nuclear weapon in a peaceful way.”

Still, the agreement is likely to face heavy opposition from key allies — chiefly Israel and Saudi Arabia — as well as congressional skeptics who have demanded much greater concessions from Iran, including the dismantling of its enrichment program.

Obama plans to speak with Israeli Prime Minister Benjamin Netanyahu on Sunday to discuss the agreement, according to a senior administration official. The official also said that the White House had begun calling lawmakers Saturday night and would continue to do so in coming days.

Republican lawmakers characterized the agreement as not going far enough.

“I have serious concerns that this agreement does not meet the standards necessary to protect the United States and our allies,” Rep. Edward R. Royce (R-Calif.), chairman of the House Foreign Affairs Committee, said in a statement. “Instead of rolling back Iran’s program, Tehran would be able to keep the key elements of its nuclear weapons-making capability. Yet we are the ones doing the dismantling — relieving Iran of the sanctions pressure built up over years.”

Others, however, hailed the successful conclusion of a deal that eased a crisis that brought the Middle East to the brink of armed conflict.

Clifford Kupchan, a former State Department official and Iran expert, called the deal “a huge win for Obama.”

“You have to give it to these guys: They put in place the most effective sanctions regime in memory and leveraged it into a deal,” Kupchan said.

Trita Parsi, president of the National Iranian American Council, said diplomacy had “delivered the U.S. and Iran from the brink of a disastrous war and placed the two countries at the beginning of a brighter, more sustainable path forward.”

Among the technical aspects of the deal, Iran agreed to halt enriching uranium to a level above 5 percent purity, a level used for nuclear reactor fuel but not approaching the 90-percent purity needed for nuclear weapons.

While Iran would be allowed to continue some uranium enrichment, it could not install new centrifuges or use thousands of others that it has manufactured but not placed into service. Iran’s total stockpile of enriched uranium would not be allowed to grow during the six-month period.

Iran also agreed to stop producing a type of more highly enriched uranium — up to 20 percent purity — and committed itself to eliminate its stockpile of this material by converting it to metal fuel rods or blending it with natural uranium.

On the key issue of Iran’s partly constructed heavy-water reactor, a potential source of plutonium, Iran agreed to halt production of fuel for the reactor and refrain from installing further reactor components.

Assuring compliance with the agreement, U.N. inspectors would be granted daily access to Iran’s nuclear facilities as well as access to data from remote cameras and sensing equipment.

According to a senior Obama administration official, U.S. officials held a series of bilateral discussions with Iranian officials throughout the fall to develop ideas that could become part of the accord reached by broader negotiations between Iran and the group of six nations.

This week the marathon discussions with Iran were described by Western diplomats as “very difficult” and “intense.” Several officials had sought to lower expectations that a resolution could be reached before Sunday, when Kerry and the other foreign ministers were due to depart.

Negotiations over the deal had remained snarled late into Saturday evening, with the foreign ministers of Britain, France, Germany, China, Russia, the European Union and the United States huddled in a hotel conference room.

Several of the diplomats met earlier in the day with Iran’s Zarif, who told reporters that the parties remained divided on key details of the six-month deal.

Kerry, Zarif and European Union foreign policy chief Catherine Ashton met late Saturday, but the session ended with no announcement of progress. Instead, Iran’s deputy foreign minister hardened his position on Iran’s right to enrich uranium, a matter of deep national pride.

Although “98 percent” of the deal was done, Iran said it could not accept any agreement that does not recognize enrichment rights, Iranian Deputy Foreign Minister Abbas Araghchi told reporters.

“Any agreement without recognizing Iran’s right to enrich, practically and verbally, will be unacceptable for Tehran,” Araghchi said, according to Reuters.

Western officials balked at recognizing a legal right to uranium enrichment, hoping instead to craft language that acknowledges the right of all countries to pursue nuclear energy for peaceful purposes. Zarif appeared to endorse that approach publicly this month.

Ed O’Keefe and Philip Rucker contributed to this report from Washington.