TEHRAN — Iran’s supreme leader on Thursday challenged two of the United States’ bedrock principles in the nuclear negotiations, declaring that all economic sanctions would have to be lifted on the day any final agreement was signed and that military sites would be strictly off limits to foreign inspectors.

The assertions by the leader, Ayatollah Ali Khamenei, could be tactical, intended to give both the negotiators and himself some political space to get Iran’s hard-liners accustomed to the framework of the nuclear deal reached a week ago with the United States and other world powers.

But they sharply illustrated the difficult hurdles that lie ahead as Secretary of State John Kerry and a large team of diplomats, energy experts and intelligence officials try to reach a June 30 deadline that would ensure that Iran could not race for a bomb for at least a decade — and would establish a permanent inspection regime to catch any cheating.

In his remarks, Ayatollah Khamenei added several stinging criticisms of Iran’s regional competitor, Saudi Arabia — calling its new leaders “inexperienced youths” — a sign of rising regional tensions that could pose another threat to the negotiations, even as diplomats strive to keep the issues on separate tracks.

King Salman, the country’s newly installed leader, is 79, though many around him are a generation younger.

Photo

Secretary of State John Kerry has said that economic sanctions against Iran would be suspended in phases, as the country complies with its obligations.Credit
Mark Wilson/Getty Images

Saudi Arabia is currently allied with the United States against Iran in the developing civil war in Yemen, which is fast becoming a major source of regional instability. Mr. Kerry accused Tehran this week of direct military support to the rebels there and warned Tehran to back off.

Ayatollah Khamenei’s comments were the first time he has discussed the framework that emerged from the nuclear talks last week in Lausanne, Switzerland. His pronouncements are considered vital because they shape the “red lines” for Iranian negotiators, though they have often showed considerable flexibility in working out details that seem to adhere to his literal meaning while still accommodating some Western demands.

For example, he had previously required that no nuclear facilities could be closed, but under the framework accord one of them — Fordo, a deep underground enrichment site — is being converted to a research center where fissile material is banned. Another, a heavy-water reactor, is being redesigned to prevent it from making bomb-grade plutonium.

On Tuesday night the director of the C.I.A., John O. Brennan, said he believed Ayatollah Khamenei had been persuaded, over the past two years, that an accord was necessary to avoid an economic free fall in Iran.

But the ayatollah himself said Thursday that he saw no need to make a clear pronouncement on the deal because no signed agreement yet existed. But he emphasized his longstanding position about the sanctions, saying that they “should be lifted all together on the same day of the agreement, not six months or one year later.”

Photo

The C.I.A. director, John O. Brennan, said he thought Ayatollah Khamenei had been convinced that a deal was necessary to avoid severe economic problems in Iran.Credit
Justin Lane/European Pressphoto Agency

The Iranian president, Hassan Rouhani, who spoke at a different event on Thursday, echoed the supreme leader’s remarks but with a potentially crucial difference, saying the sanctions have to be lifted on the day a deal is put in place, potentially months after a signed agreement.

“We will not sign any agreement unless all economic sanctions are totally lifted on the first day of the implementation of the deal,” Mr. Rouhani said during a ceremony for Iran’s nuclear technology day, which celebrates the country’s nuclear achievements.

While the June 30 deadline is still months away, the ayatollah’s comments pose some significant potential challenges to Mr. Kerry and his negotiating team.

Mr. Kerry and President Obama have been saying that sanctions would be suspended in phases, as Iran complied with its obligations. That is critical to American leverage in making sure that Iran follows through on its commitments to vastly reduce its uranium stockpile — a process that will take months, if not longer — and decommissions centrifuges, placing them in storage.

On Wednesday night, on the “PBS NewsHour,” Mr. Kerry said that in any final agreement, Iran would also have to resolve outstanding questions with the International Atomic Energy Agency over suspected military dimensions of the nuclear program. “It will be part of a final agreement,” he said. “It has to be.”

Mr. Kerry’s assurances did little to mollify the deal’s many congressional critics, who pounced on Ayatollah Khamenei’s comments as proof that the nuclear deal is unworkable.

“As each new day reveals a new disagreement, it’s increasingly clear that Iran, in fact, failed to reach agreement with the United States and its partners on a political framework that addresses all parameters of a comprehensive agreement,” said Senator Mark Kirk, Republican of Illinois. who has led an effort to impose new sanctions on Iran — a step President Obama says is clearly intended to blow up any progress that has been made.

In his remarks Thursday, Ayatollah Khamenei seemed to rule out any inspections inside military bases or compounds.

That could become problematic. While Mr. Obama and Mr. Kerry have said the inspection requirements they have negotiated would be among the most intrusive in history, they have not said whether they would extend to military sites. Several of the sites the United States is most concerned about in Iran are on military bases, including Fordo. Inspectors have visited the site regularly, and the atomic energy agency has, periodically, been allowed onto other military bases.

Similarly, the timing of sanctions relief is far more complicated than simply setting a date. Even with cooperation from the Iranian side, the technical issues are so complex that agency officials say resolving them will be a lengthy process.

Other sanctions are based on United Nations Security Council resolutions. Mr. Kerry said in Lausanne last week that under a final deal, if one is reached, a new set of resolutions would be passed, ending many of the sanctions but keeping proliferation controls in place.

Even if sanctions are legally eliminated, major corporate players may initially be reluctant to do business in Iran. Banks have been heavily fined for violations and would want assurances about the new rules. Investors may fear that sanctions could “snap back” if there was a dispute between Iran and the West, leaving their investments stranded.

Ayatollah Khamenei may have thrown another new factor into the equation by suggesting there was plenty of time to consider a deal and review the actions of opponents, and said the deadline of June 30 was in no way sacred.

“They might say that we have only three months left. Well, if three months becomes four months the sky won’t come falling down,” he said. “Just as the other side pushed the negotiations back by seven months,” he added, referring to an extension decided in November.

However, June 30 is the date at which the current extension of negotiations runs out. So unless it is renewed — something both sides have previously rejected — the temporary limits on Iran’s enrichment activities will terminate that day. And after June 30, Congress has threatened to impose new sanctions if a satisfactory deal is not in place.

Ayatollah Khamenei did not criticize those details of the framework that had already been agreed to, even though some of them, if put in place, would represent big compromises from all parties, including Iran.

He repeated that while he was not optimistic about negotiating with world powers — especially with the United States — he did support the talks and Iran’s diplomatic team.

“I have agreed to this particular instance of negotiations and I support the negotiators,” Ayatollah Khamenei said, according to his official website, Khamenei.ir.

In recent days, almost all major figures in the Iranian establishment have come out in support of the framework agreement, while adding the usual caveat that Iran’s rights must be guaranteed. Most, including Friday Prayer leaders and military commanders, have said they supported the talks.

Yet, speaking to an audience of religious chanters in his Tehran office, the ayatollah said the government should allow critics of the deal to speak their minds, “as it will help unity” in the country.

It must be clear, the ayatollah said, that the negotiations were not going beyond the nuclear field. “But,” he continued, “if the other side refrains from its normal bad actions, this will become an experience that we can continue on other issues. If we see that once again they repeat their bad actions, it will only strengthen our experience of not trusting America.”

With the ayatollah’s unusually strong remarks about the Saudis on Thursday, the sectarian-tinged fighting in Yemen seemed potentially to be developing into yet another wedge between Washington and Tehran.

Thomas Erdbrink reported from Tehran, and David E. Sanger from Washington.

A version of this article appears in print on April 10, 2015, on Page A1 of the New York edition with the headline: Leader of Iran Challenges U.S. On Pact Details. Order Reprints|Today's Paper|Subscribe