U.S. Secretary of State John Kerry, right, and Iranian Foreign Minister Javad Zarif, left, shake hands as Omani Minister Responsible for Foreign Affairs Yussef bin Alawi, second right, and former E.U. top diplomat Catherine Ashton watch in Muscat, Oman on November 9, 2014. (Nicholas Kamm/AFP/Getty Images)

The urgent quest for a breakthrough in talks to rein in Iran’s nuclear capacity led negotiators to meet into the night Sunday with a deadline looming over their heads.

Secretary of State John F. ­Kerry, Iranian Foreign Minister Mohammad Javad Zarif and Catherine Ashton, the European Union’s foreign policy chief, met for three hours in the early afternoon, and more than two hours more after nightfall. A U.S. official said talks would resume here at the meeting site, a resort along a scenic beach between the Hajar Mountains and the Indian Ocean, on Monday morning.

The mere fact they are still at it suggests progress is still possible, as more than a decade of negotiations boil down to the final two weeks before a Nov. 24 deadline. If the date passes without a deal or an extension, an interim pact dies, dealing a potentially fatal blow to the international effort to keep the Islamic republic from building a bomb.

Important differences remain unresolved, including the level of uranium-enrichment capacity Iran will be permitted to retain, and the pace for phasing out international sanctions.

For the United States and its five negotiating partners, the goal is to make sure that all pathways to an Iranian bomb would be visible and time-consuming. Iran seeks relief from the punishing sanctions hobbling its economy when falling oil prices are strangling revenue.

If basic principles can be ­settled by the deadline, talks on minor details could continue. But delay carries political complications, emboldening critics in Iran and the United States.

Congress must approve a permanent lifting of U.S. sanctions. That becomes more difficult next year, after Republicans take control in the Senate. Skeptics in Congress, suspicious that Iran will cheat, want to impose even more sanctions. But that could prompt Iran to abandon the ­negotiating table and resume enriching uranium to levels high enough for weapons-grade fuel.

Some GOP lawmakers have expressed outrage over a letter, first reported in the Wall Street ­Journal, from President Obama to Iran’s supreme leader, ­Ayatollah Ali Khamenei, saying the two countries have a common interest in fighting the Islamic State, but working together is possible only if a nuclear deal is sealed.

Kerry on Saturday declined to confirm the letter’s existence but forcefully denied any linkage between fighting the Islamic State and a nuclear deal.

“The nuclear negotiations are on their own,” he told reporters in Beijing.

Further complicating the atmosphere surrounding the talks, Khamenei chose Sunday to tweet a plan to eliminate the “fake Zionist regime,” a reference to Israel.

The post on Khamenei’s official Twitter account called for a referendum by all Muslims, Jews and Christians who trace their lineage to Palestine to simply vote out the “usurper Zionists.”

In response, Israeli Prime ­Minister Benjamin Netanyahu said Israel would not accept an agreement that leaves Iran as a “nuclear threshold state.”

That is exactly what the United States is trying to prevent. Iran has always insisted it wants to develop its nuclear strength ­solely for peaceful purposes such as energy and medicine. Over time, its nuclear capacity has grown while demands for limits have softened.

For example, Iran currently has 19,000 centrifuges, which are used to enrich uranium. The negotiating partners, known as the P5+1 — five permanent members of the U.N. Security Council and Germany – want those numbers sliced. They initially tried to limit them to 1,000 or 2,000, but now are willing to allow more, with transparent monitoring so that even if Iran decides down the road to make a bomb, it would have to start from a low level of capacity. That would make it so obvious that the world would have time to respond.

Negotiations have been underway since 2003 . But they ­floundered until late last year, when the moderate Hassan ­Rouhani was elected president of Iran. Seeing an opening, Oman’s Sultan Qaboos bin Said hosted secret talks between Iran and the United States at his beachfront villa.

Under the resulting interim agreement, Iran agreed to stop enrichment above 5 percent, not install more centrifuges and not increase its stockpile of uranium. In return, Iran got a measure of relief from some sanctions.

But a final agreement has proven elusive. Even as the remaining weeks have dwindled down, the International Atomic Energy Agency says Iran still has not been forthcoming about its current and past use of nuclear materials, as it promised it would be. As a result, the agency says it can verify that the materials it knows about have not been diverted for possible military use, but it cannot say conclusively that Iran does not possess other nuclear materials that could be covertly diverted.

Back in Oman, where the latest round of talks were birthed, the parties insist the deadline can be met. Iran’s deputy foreign minister on Saturday called a deal “within reach.”