U.S. President Barack Obama and Iranian President Hassan Rohani spoke by phone on Friday, the highest-level contact between the two countries since the Iranian Revolution in 1979 and a sign that both sides are serious about reaching a pact on Iran's nuclear program.

Obama had hoped to meet with Rohani earlier this week while both men were in New York for the United Nations General Assembly, but Iran decided a meeting would be too complicated. 

A senior administration official said late Friday that the U.S. had communicated with the Israeli government about the phone conversation, Reuters reported. The Israeli government has every right to be skeptical of Iran's government pledges to resolve international concerns over its nuclear program, the official said, and the administration intended to keep Israel informed as contacts with Iran continue. 

"I reiterated to President Rohani what I said in New York. While there will surely be important obstacles to moving forward and success is by no means guaranteed, I believe we can reach a comprehensive solution," Obama said at the White House. 

Obama said both men had directed their teams to work expeditiously toward an agreement on the nuclear issue. 

Rohani said on a Twitter feed believed to be genuine that in his phone conversation he told Obama "Have a Nice Day!" and Obama responded with "Thank you. Khodahafez (goodbye)." 

The two men "expressed their mutual political will to rapidly solve the nuclear issue," the Twitter account said. 

As president, Rohani is the head of the government but has limited powers. Supreme Leader Ayatollah Ali Khamenei is the ultimate authority in Iran with final say on domestic and foreign policy, though Rohani says he has been given full authority to negotiate on the nuclear issue. 

Obama made reference to that power structure in his remarks and suggested that an agreement could achieve what Iran's leaders desire: winding down of crippling economic sanctions. 

"Iran's supreme leader has issued a fatwa against the development of nuclear weapons. President Rohani has indicated that Iran will never develop nuclear weapons," Obama said. 

"I've made clear that we respect the right of the Iranian people to access peaceful nuclear energy in the context of Iran meeting its obligations. So the test will be meaningful, transparent and verifiable actions, which can also bring relief from the comprehensive international sanctions that are currently in place." 

Rohani said earlier Friday that Obama struck a new tone in his UN speech this week that left him optimistic about easing tensions between the two countries.

Rohani also said the recent elections that propelled him to the Iranian presidency created a "new environment" that could pave the way for better relations with the West.

Rohani said at a news conference in New York that he did not meet with Obama on the sidelines of the UN General Assembly this week because there was not enough time to plan such a high-stakes meeting.

But he said Iran emerged hopeful from a lower-level meeting with the U.S. and its international partners aimed at restarting talks to settle their nuclear standoff.

Rohani also said that he wanted talks with major powers on Iran's nuclear program to yield results in a short period of time.

"The atmosphere (in Iran-U.S. ties) is quite different from the past," Rouhani told a news conference on the sidelines of the UN General Assembly in New York, a day after the highest-level talks between the United States and Iran in a generation.

"Our goal is the shared interest between the two nations. Our goal is resolving problems, our goal is step-by-step creating trust between the governments and peoples," Rohani said.

The Iranian president also said he hoped nuclear talks with the United States and other powers "will yield, in a short period of time, tangible results."