Secretary of State John F. Kerry is asking for everyone to be understanding of the time constraints negotiators are facing but says nuclear talks between Iran and major powers are progressing. (Reuters)

Iran’s foreign minister released a video message Friday as nuclear talks were nearing an end, saying an agreement is at hand and can be reached if the United States and its partners choose cooperation over coercion.

“At this eleventh hour, despite some differences that remain, we have never been closer to a lasting outcome,” said Mohammad Javad Zarif, Iran’s top diplomat and lead negotiator. “But there is no guarantee. Getting to yes requires the courage to compromise, the self-confidence to be flexible.”

Zarif, standing on the balcony of Vienna’s Coburg Palace, where the talks are underway, spoke in English as music played softly in the background. Delivered on YouTube, his words were apparently an appeal to public and political opinion in the United States, and in the five countries that are its negotiating partners.

“Some stubbornly believe that military and economic coercion can ensure submission,” he said. “I see hope, because I see the emergence of reason over illusion.”

Zarif’s video comes as more than a year and a half of talks are culminating in a frenzied round of sessions aimed at getting Iran to curb its nuclear program in exchange for the lifting of international sanctions. Zarif and Secretary of State John F. Kerry, who has been here for a week, met twice Friday and plan to keep working through the weekend to meet a Tuesday deadline.

Iranian Foreign Minister Mohammad Javad Zarif, right, and the head of the Iranian Atomic Energy Organization, Ali Akbar Salehi, are pictured during a meeting with Kerry in Vienna on July 3, 2015. (Carlos Barria/AFP/Getty Images)

Foreign ministers from the other countries on the U.S. side of the table — Britain, France, China, Russia and Germany — are expected to return to Vienna on Sunday to make final decisions on a deal.

“We’re really in the endgame of all this,” said a senior State Department official, who spoke on the condition of anonymity about the confidential talks. “We’re certainly making progress, there’s no doubt about that. But there are still big issues not resolved. That’s why people are burning the midnight oil.”

The official said that if negotiators can agree to closely follow principles set out in an interim accord adopted in early April, they will have a deal. But if the “right choices” aren’t made, he added, the United States is “more than comfortable stepping away.”

In another indication of intensifying talks, Iran on Friday dispatched Mohammad Nahavandian, the chief of staff to President Hassan Rouhani and a prominent economist, to join the Iranian negotiating team. His presence suggested a renewed focus on sanctions after some apparent progress earlier in the week on procedures to allow international inspectors access to a broad array of Iranian nuclear facilities. Talks have also focused on bridging the gap between Tehran’s insistence that sanctions be lifted immediately after an agreement is struck and the U.S. position that sanctions remain in place until Iranian compliance with all other terms of the deal has been verified.

Under the principle of “simultaneity,” provisions of the deal would not immediately take effect. Instead, both sides would take time to lay the groundwork for agreements on lifting sanctions and verification to go into effect at a mutually agreed date.

Some issues related to verification, and how Iran will get rid of excess enriched uranium it still has, are unresolved. Yukiya Amano, the head of the International Atomic Energy Agency, returned Friday to Vienna from Tehran, where he met with Rouhani and the secretary of the Supreme National Security Council of Iran, Ali Shamkhani.

Amano said he had discussed issues related to the IAEA’s monitoring and verification of Iranian commitments, as well as his agency’s ongoing investigation into the possible military dimensions of Iran’s nuclear programs.

The United States and other countries believe Tehran once was working to develop an atomic weapon, an allegation Tehran has denied. After meeting Thursday with Amano, Rouhani said the IAEA understands the “pointless allegations” are “baseless.”

Although the Obama administration has said that a nuclear accord with Iran would not automatically lead to a warming of relations, Zarif in his video moved beyond discussion of the current negotiations to talk about “the growing menace of violent extremism and outright barbarism” that he said was “our common threat today.” Saying that Iran had “long been at the forefront in the fight against extremism,” he expressed hope that others would join that effort.

The two governments are working separately with Iraq to oppose Islamic State extremists in that country but are on opposite sides in the civil war in Iraq’s neighbor Syria, where Iran is the principal diplomatic and military backer of the government of President Bashar al-Assad.

The United States has also labeled Iran a state sponsor of terrorism and condemned its backing of other groups considered terrorist by the United States, including Lebanon-based Hezbollah and Hamas in the Gaza Strip.

The Vienna talks, the senior U.S. official said, “are about the nuclear issue.” Although it is “true that ISIL is a valid enemy of Iran and true that ISIL is an enemy of the United States, I wouldn’t go any farther than that in terms of projecting our ability to collaborate down the road.”