President Obama and the newly elected president of Iran signaled willingness to improve ties between their nations Monday, but both leaders made clear that a positive tone may not easily translate into progress in resolving the dispute over Iran’s nuclear program.

In his first news conference since being elected president of Iran on Friday, moderate cleric Hassan Rouhani said he wanted better relations with Washington. But he ruled out suspending Iran’s nuclear enrichment program, the biggest source of tensions between the two governments over the past decade, saying, “Those days are behind us.”

“All should know that the next government will not budge defending our inalienable rights,” Rouhani, a former nuclear negotiator, told reporters at a Tehran think tank that he has helped run.

Rouhani, who is to take office Aug. 3, said he wants to reduce tensions with the United States, and he called the animosity between the two sides “an old wound that must be treated” before relations can be normalized.

Obama, in his first public comments about the Iranian election, also sounded a hopeful note, saying he wants “a more serious, substantive” engagement with Tehran. But he said Iran’s leaders would have to show a genuine willingness to compromise before Washington would agree to roll back the economic sanctions that have crippled the Islamic republic’s economy.

“Those will not be lifted in the absence of significant steps in showing the international community that Iran is not pursuing a nuclear weapon,” the president said in an interview broadcast Monday night on the “Charlie Rose” show on PBS.

Obama’s comments reflected the complexity of the challenge confronting the administration as it decides how to react to Rouhani’s unexpected, first-round election victory. Administration officials and independent experts expressed cautious optimism over the election of a self-declared reformer who promised more political freedom for Iranians and a more pragmatic, less confrontational foreign policy.

But current and former administration officials acknowledged that it is far from certain that Rouhani will have the power to change nuclear policies, which are largely controlled by Iran’s unelected supreme leader, Ayatollah Ali Khamenei. Equally unclear is whether Rouhani, a longtime Khamenei ally, has any intention of changing the country’s nuclear course.

“The administration has to tread a careful line, being neither gratuitously dismissive nor preemptively accommodating,” said Michael Singh, who was an adviser on Middle East policy at the National Security Council under President George W. Bush. “We’ll have to see whether Rouhani means what he says, and whether he really thinks that changes are needed in areas like nuclear policy — and whether he is empowered to make those changes.”

Obama appeared to rule out any immediate easing of economic sanctions, which have dried up more than a third of Iran’s oil revenue and slashed the value of the national currency, the rial. The country’s economic troubles are thought to be partly behind Rouhani’s blowout victory over a slate of more-conservative candidates.

“I think we understand that under their system the supreme leader will be making a lot of decisions,” Obama said in the PBS interview, which was taped Sunday, less than 24 hours after Rouhani was certified as the winner of the election to replace two-term president Mahmoud Ahmadinejad.

“We’re going to have to continue to see how this develops and how this evolves over the next several weeks, months, years,” he said.

Dennis Ross, a diplomat who was once the president’s top adviser on Iran, said the administration should quickly put Rouhani’s promises to the test, noting Iran’s rapid gains in nuclear technology.

“Rouhani is coming out of a system that has always cheated,” Ross said. “Their behavior over the years would show there is no basis for simply trusting what they say.”

Rouhani’s past offered some reason for optimism. As Iran’s lead nuclear negotiator, he agreed to suspend uranium enrichment in 2003 as a trust-building measure in negotiations with European countries. But he made clear Monday that the situation has since changed, as Iran has expanded its stockpile of enriched uranium and defied a decade of U.N. resolutions urging more transparency on a program that Tehran says is purely for civilian purposes.

Rouhani outlined several preconditions to beginning what he called a “constructive dialogue” with Washington. “First, America must not interfere in Iran’s domestic affairs based on the Algiers Accords,” he said, referring to the agreement that ended the Iran hostage crisis in 1981. “They have to recognize our nuclear rights, put away bullying policies against Iran. And if such, and they have good intent, then the situation will change.”

He also said that relations between the United States and Iran are “complicated and difficult,” adding that any bilateral talks “should be based on mutual respect and from an equal stance.”

On Sunday, Rouhani said he had made his first policy-shaping move by discussing economic woes and living conditions with Ali Larijani, head of Iran’s majority-­conservative parliament.

While insisting that Tehran would continue to pursue what he described as peaceful nuclear energy, he called for a “more active” phase of international diplomacy, including talks with the six-nation bloc that is seeking to negotiate limits on Iran’s production of enriched uranium.

Rouhani also discussed the conflict in Syria, criticizing the U.S. decision last week to arm rebel groups and giving no sign that Iran would, under his stewardship, retract its support for the government of Syrian President Bashar al-Assad.

“The final decision-maker for Syria is the Syrian people,” Rouhani said. “Of course, we are against terrorism and foreign intervention. We hope that with the help of all countries, peace returns to Syria.”

Rezaian reported from Tehran.