Negotiators from the P5+1 were back in Vienna, Austria Sunday for the last two days of talks to agree on a nuclear deal with Iran even as the Iranian foreign minister returned home for consultation.

Iranian Foreign Minister Mohammad Javad Zarif talked with Secretary of State John F. Kerry for 20 minutes before flying back to Tehran on Sunday.

"We have given the necessary instructions to our negotiating teams to continue working on the text," Zarif said, referring to the draft framework of the accord reached in Lausanne, Switzerland in April, according to AFP.

Under the Lausanne framework, Iran will slash the number of its uranium enrichment centrifuges for making nuclear fuel, reduce its uranium stockpile and change the design of a reactor in Arak.

The framework also provides that the P5+1 group composed of Britain, China, France, Germany, Russia and the U.S. lift economic sanctions against Iran, including limits to its access to the world oil markets.

European Union foreign policy chief Federica Mogherini is optimistic that a deal would be finalized by the talks' deadline on Tuesday.

"We are near to close the deal, it is a good deal," Mogherini told reporters on Sunday after meetings with Kerry and Zarif, according to Iranian news agency IRNA.

U.S. officials, however, see the talks extending beyond Tuesday as major differences still divide the two sides.

It will be all but impossible to reach a comprehensive agreement before the June 30 deadline and talks would continue for "a few days" beyond it, a senior State Department official said, according to The Washington Post.

There is disagreement over the pace at which sanctions would be lifted and how much access Iran would give to International Atomic Energy Agency (IAEA) inspectors to monitor Iran's compliance with the nuclear deal.

Supreme Leader Ayatollah Ali Khamenei last week demanded that all financial and economic sanctions be lifted on the day a deal is reached, IAEA inspectors don't check Iranian military sites and a long-term deal of 10 years or more be rejected.

Meanwhile, British Foreign Secretary Philip Hammond warned the six world powers might walk away from the negotiating table if they don't like Iran's offers. "No deal is better than a bad deal. There are red lines that we cannot cross and some very difficult decisions and tough choices are going to have to be made by all of us," Hammond told reporters, according to AFP.