Top P5+1 diplomats worked past a midnight deadline into the early hours of Wednesday seeking to agree on the outlines of a nuclear deal with Iran, while the US threatened to “walk away” from negotiations if an accord could not be reached.

As the world powers were negotiating on a sixth day of talks in Switzerland aimed at laying the groundwork for a deal that they hope will prevent Iran developing nuclear weapons under the guise of its civilian program, the White House indicated that should a deal for a political framework not be reached, the US would leave the talks ahead of the final deadline in late June.

“If we’re not able to reach a political agreement, then we’re not going to wait … until June 30 to walk away,” said White House spokesman Josh Earnest on Tuesday.

Meanwhile the US has denied that Iran was given an ultimatum late Tuesday to decide whether to accept the deal offered by the P5+1 lest its representatives leave Switzerland by dawn.

According to Reuters, two European diplomats said that the major powers “did not want to continue negotiating beyond the early morning on Wednesday.”

A US official told the news agency that the report was “false.”

Earlier, the US said “enough progress” was made so as to merit extending marathon talks into Wednesday.

“We’ve made enough progress in the last days to merit staying until Wednesday. There are several difficult issues still remaining,” State Department spokeswoman Marie Harf said.

Earlier Chinese Foreign Minister Wang Yi left the crunch talks in Lausanne as his French counterpart Laurent Fabius said that the negotiations were “complicated… long and difficult.”

A German diplomatic source also said the talks were “difficult” with a “changeable atmosphere” and “frequent breaks to negotiate in smaller groups.”

A Western diplomat said the army of technical and sanctions experts would continue plugging away “for (the) next hours. All parties (are) working hard and (are) committed to finding a solution.”

Senior Iranian negotiator Hamid Baidinejad said: “The negotiations will end when solutions have been found… We are ready to continue. We are not watching the clock.”

The return earlier to Lausanne of Russian Foreign Minister Sergei Lavrov had brought a ray of optimism, having said in Moscow before leaving that the chances of an accord were “high.”

Under a deal to be finalized by June 30, the powers want Iran to scale back its nuclear program to give the world ample notice of any dash to make the bomb by extending the so-called “breakout” time.

In return, the Islamic Republic is demanding the lifting of sanctions that have strangled its economy.

But the question is how much detail will be in the framework accord that Iran and the six powers — the US, China, Russia, Britain, France and Germany — want to leave Lausanne having secured.

If it falls short of firm commitments by Iran then US President Barack Obama will find it hard to fend off attempts by his Republican opponents to pass fresh sanctions on Tehran.

Iran’s negotiators are also under pressure from their own domestic hardliners not to give too much away and for President Hassan Rouhani to deliver on his promises to secure the lifting of sanctions.

Fresh US sanctions could therefore torpedo the whole negotiating process that was launched after Rouhani became president in 2013.

Republicans fear that since some of its nuclear infrastructure will likely stay intact, Iran will still be able to get the bomb — a concern shared by Israeli Prime Minister Benjamin Netanyahu

“The greatest threat to our security and our future was and remains Iran’s attempt to be armed with nuclear weapons. The agreement being formulated in Lausanne paves the way to that goal,” Netanyahu told parliament Tuesday.

“We will do everything to protect our security and our future,” he said.

Saudi Arabia, which has led an Arab coalition bombing Iran-backed rebels in Yemen in recent days, is also alarmed by what is unfolding in Lausanne.

Its Foreign Minister Prince Saud al-Faisal called on the six powers not to “short-circuit the interests of the states of the region by dangling before Iran benefits that it will not be able to reap without cooperation with the countries of the region.”

Some areas of the mooted deal, including the future size of Iran’s uranium enrichment capacity — a process for making nuclear fuel but also the core of an atomic bomb — appear to have been tentatively sewn up.

But the two sides still appear wide apart on other areas, including what to do with Iran’s stockpiles of nuclear material and the pace at which sanctions would be eased.

The six powers are only prepared to suspend sanctions, not terminate them, in order to be able to put them back into place if Tehran violates the deal.

Other tricky issues include the duration of any accord, with Iran resisting demands by the powers to submit to ultra-tight inspections by the UN atomic watchdog for at least a decade.