An agreement aimed at curbing Iran's nuclear program in exchange for sanctions relief will likely be announced Monday, according to a published report. 

Two diplomats involved in ongoing talks in the Austrian capital of Vienna told the Associated Press Sunday that final details of the pact were still being worked out. Once it is complete, a formal, final agreement would be open to review by officials in the capitals of Iran and the six world powers at the talks, they said. The diplomats involved demanded anonymity because they were not authorized to discuss the negotiations publicly. 

The envoys had said that it was possible for a provisional agreement to have been reached Sunday evening. However, senior Iranian and U.S. officials told the AP there was not enough time to do so.

"We are working hard, but a deal tonight is simply logistically impossible," the Iranian official said, noting that the agreement will run roughly 100 pages.

The senior U.S. official declined to speculate as to the timing of any agreement or announcement but said "major issues remain to be resolved."

More On This...

Despite the caution, the negotiators appeared to be on the cusp of an agreement.

U.S. Secretary of State John Kerry, who on Thursday had threatened to walk away from the negotiations, said Sunday that "a few tough things" remain in the way but added "we're getting to some real decisions."

En route to Mass at Vienna's gothic St. Stephens Cathedral, Kerry said twice he was "hopeful" after a "very good meeting" Saturday with Iranian Foreign Minister Mohammad Javad Zarif, who had Muslim services Friday. The two met again early Saturday evening.

French Foreign Minister Laurent Fabius also was cautiously optimistic, telling reporters Sunday:  "I hope that we are finally entering the last phase of this negotiation."

In Iran, President Hassan Rouhani said an agreement was close, but not quite done, describing the negotiations as "still steps away from reaching the intended peak."

Kerry, Russian Foreign Minister Sergey Lavrov and other foreign ministers held a dinner Sunday night. Chinese Foreign Minister Wang Yi arrived overnight, the Xinhua News Agency reported. The other foreign ministers of the six nations negotiating with Iran already are in or are planning to arrive in Vienna and in position to join Kerry and Zarif for an announcement.

Movement toward a deal has been marked by years of tough negotiations. The pact is meant to impose long-term, verifiable limits on nuclear programs that Tehran could modify to produce weapons. Iran, in return, would get tens of billions of dollars in sanctions relief.

The current round of nuclear talks is now in its 16th day and has been extended three times since the first deadline of June 30 was missed. The mood among negotiators had turned more somber each time a new target date -- first July 7, then July 10 and then July 13 -- was set.

As the weekend approached, Kerry declared the talks couldn't go on indefinitely and warned that the U.S. could walk away from the negotiations.

Diplomats familiar with the talks said most of the nuts and bolts of implementing the deal have been agreed upon. But over the past week, issues that were previously on the back burner have led to new disputes. Among them is Iran's demand for a lifting of a U.N. arms embargo and its insistence that any U.N. Security Council resolution approving the nuclear deal be written in a way that stops describing Iran's nuclear activities as illegal.

A diplomat familiar with the negotiations said disagreements also persist on how long some of the restrictions on imports of nuclear technology and other embargos outlined in any new Security Council resolution will last. The diplomat, who demanded anonymity because the diplomat wasn't allowed to discuss the confidential talks, said restrictions will last for years, not months.

Meanwhile, Iranians were preparing to celebrate in the event of an agreement. Iran's semi-official ISNA news agency reported that deputy police chief Brigadier General Saeed Montazer al-Mahdi said the authorities are fully prepared for such celebrations.

Despite Kerry's relatively upbeat take, comments by Iran's supreme leader suggested that Tehran's mistrust of Washington would persist no matter what the outcome of the talks.

Iran's state-run Press TV cited Ayatollah Ali Khamenei on Saturday as calling the U.S. an "excellent example of arrogance." It said Khamenei told university students in Tehran to be "prepared to continue the struggle against arrogant powers."

His comments appeared to be a blow to U.S. hopes that an agreement will lead to improved bilateral relations that could translate into increased cooperation in a common cause-- the fight against the ISIS terror group.

Zarif had hinted at just that last week, suggesting a deal acceptable to his country will open the door to joint efforts on that front.

Israeli Prime Minister Benjamin Netanyahu, a fierce opponent of what he considers a deal that is too lenient on Tehran, said Khamenei's comments showed that Western powers are "caving" in to Iran even as the Islamic republic keeps railing against them.

A nuclear deal will also face serious scrutiny from members of Congress.

"This is going to be a very hard sell for the administration," Senate Majority Leader Mitch McConnell, R-Ky., said on "Fox News Sunday" when asked about the likelihood of Congress signing off on a deal. "We already know it's going to leave Iran as a threshold nuclear state."

The Associated Press contributed to this report.