Ayatollah Ali Khamenei, whose recent public pronouncements have usually been skeptical about the talks, promised in a speech to Iranian air force officials that "I would go along with the agreement in the making," the official Islamic Republic News Agency reported.
"Our negotiators are trying to take the weapon of sanctions away from the enemy," he said. "If they can, so much the better. If they fail, everyone should know there are many ways at our disposal to dull this weapon."
Khamenei spoke at a gathering in Tehran as his foreign minister, Mohammad Javad Zarif, met in Munich, Germany, with Secretary of State John F. Kerry to try to work out the broad outline of a deal before a March 24 deadline.
Iran and six world powers are trying to craft a deal that would ease international sanctions on Iran in return for its acceptance of restrictions aimed at preventing it from gaining nuclear weapons capability.
Kerry kept up the pressure for reaching a deal by next month's deadline, saying in an appearance on NBC's "Meet the Press" that a further extension would be nearly "impossible."
"The only chance I can see of an extension at this point in time would be that you really have the outlines of the agreement," Kerry said.
Since the talks began a year ago, Khamenei has generally been negative, saying he has no confidence in U.S. intentions and insisting that Iran preserve all of its nuclear infrastructure. Those statements have been well-received by Iran's hard-liners, who have appeared to be gaining an edge over officials allied with Zarif and President Hassan Rouhani, who favor a deal.
But Khamenei also has reasons to want to appear open to a deal. Many Iranians are desperate for economic relief from the punishment of sanctions.
If talks collapse, Iran will want to argue to the world that it negotiated in good faith and the obstacle has been Western and Israeli intransigence. Iran wants to be in position to argue that restrictions on its oil sales should end.
Negotiators twice failed to meet deadlines last year, in July and November.
As the latest deadline has approached, skeptics about a deal in Congress and in Israel have begun warning that the Obama administration is about to accept terms that would allow Iran to complete its long effort to gain weapons capability.
Israeli Prime Minister Benjamin Netanyahu warned Sunday that negotiators "are galloping toward an agreement that will allow Iran to arm itself with nuclear weapons that will endanger the existence of the state of Israel." He said he would do everything in his power to stop such an agreement.
Zarif said in a speech at an international security conference in Munich that he opposed any further extension of the talks.
"We need to seize this opportunity," he said. "It may not be repeated."
Zarif repeated Iran's demands that all sanctions should be removed quickly if a deal is reached.
Despite the declarations from Kerry and Zarif that the talks need to be concluded quickly, both sides may find it difficult to halt talks if they don't reach a deal in March.
Under an interim agreement, Iran has stopped further enrichment and the U.S. and its allies have eased some sanctions. Ending the talks would raise the risk that Iran would resume a full-scale effort to gain the capability to build a bomb.
That would raise the risk of a military confrontation between Iran and the U.S. or Israel, something that few on either side want at a moment when the Middle East is already racked by civil wars and a struggle against the Islamic State militant group.
The United States and Iran have found themselves on the same side in the fight against Islamic State, although they insist that there has been no coordination between them.