Updated

President Obama and Iranian President Hassan Rouhani thawed a three-decade freeze in relations between their two countries Friday, speaking by phone in the first conversation between an American and Iranian president since 1979.

The president revealed Friday afternoon that the two leaders had spoken. He said he believes the two countries can reach a “comprehensive solution” on Iran’s nuclear program, and said he and Rouhani had both directed their diplomats to pursue an agreement.

"I do believe there is a basis for a resolution," he said.

The call is sure to rankle some U.S. lawmakers, as well as Israeli leaders, cautious about engaging the new Iranian president too quickly. The conversation also came amid a bruising battle on Capitol Hill over the budget, stoking complaints that Obama is ignoring Republicans while engaging America's adversaries.  Kevin Smith, a spokesman for House Speaker John Boehner, tweeted: "[Obama] negotiates with Iran, Putin but not Congress #shocking."

House Majority Leader Eric Cantor expressed skepticism about Obama’s claim that Rouhani represented “new leadership” in Iran, saying in a statement, “Supreme Leader Ayatollah Khamenei remains the true ruler in Tehran, and we are only fooling ourselves when we suggest otherwise.”

More On This...

    The call comes after Secretary of State John Kerry met Thursday in New York with his Iranian counterpart on the sidelines of the United Nations session. The White House had apparently floated the possibility of Obama meeting, casually, with Rouhani in New York, but U.S. officials said the Iranians nixed the idea.

    Senior administration officials said Friday that the Iranians later opened up to the possibility of a phone call between the two leaders. They said the call lasted roughly 15 minutes, and was cordial in tone.

    "I reiterated to President Rouhani 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.

    He also noted “the very fact that this was the first communications between an American and Iranian president since 1979 underscores the deep mistrust between our countries, but it also indicates the prospect of moving beyond that difficult history. ... the test will be meaningful, transparent, and verifiable actions.”

    He said the U.S. will coordinate closely with its allies, including Israel, which considers an Iranian nuclear weapon capability to be an existential threat.

    However, it appeared the two countries still had a long way to go resolving their relations. The Wall Street Journal reported Friday that U.S. officials alleged Iran have hacked unclassified Navy computers in recent weeks. If true, it would mark one of the most serious infiltrations of government computer systems by the Iranians.

    A Department of Defense spokesman refused to comment for reasons of operational security.

    Mike Rogers, chairman of the House Intelligence Committee, said late Friday he is skeptical that any agreement to negotiate an end to sanctions would buy Iran more time to achieve their nuclear ambitions.

    "President Obama should be cautious to not negotiate a deal for posterity’s sake, or a deal that is not in the best interests of the United States,” Rogers said in a statement.

    President Obama’s conversation came hours after Rouhani, wrapping up a trip to the U.S., called the United States a "great" nation, a sharp reversal from his predecessors that buoyed hopes that the two governments can stop the escalation of tensions.

    "I want it to be the case that this trip will be a first step, and a beginning for better and constructive relations with countries of the world as well as a first step for a better relationship between the two great nations of Iran and the United States of America," Rouhani told a news conference at a hotel near U.N. headquarters.

    The countries' disagreements are grave and plentiful. Relations have experienced few ups and countless downs since the 1979 Islamic Revolution and subsequent hostage crisis at the U.S. Embassy in Tehran.

    Obama’s remarks followed the brief meeting Thursday night at the United Nations between Kerry, his Iranian counterpart and several other diplomats.

    EU foreign policy chief Catherine Ashton later described those talks as “substantial” and said they had set the stage for a new round of negotiations over Iran’s nuclear program Oct. 15-16 in Geneva.

    Speaking to reporters later, Kerry warned there was still “a lot of work to be done” but added he welcomed the “change in tone.”

    Iranian Foreign Minister Javad Zarif said he was "satisfied with this first step."

    Kerry sat next to Zarif at the meeting, the Associated Press reported. Others attending were the five permanent members of the U.N. Security Council and Germany.

    The diplomats met on the sidelines of the U.N. General Assembly in New York.

    The Associated Press contributed to this report.