During a White House press conference, Mr. Obama told reporters that his conversation with Rouhani was constructive.
"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," he said.
The president also noted that while the lengthy lack of communication between the two country's leaders indicated "deep mistrust between our countries," this could also be the time to move forward.
"I do believe there is a basis for a resolution," he said.
The Iranian news agency IRNA confirmed the call to ABC News, saying it took place while Rouhani was in a car and heading towards John F. Kennedy International Airport. Rouhani had been in New York for the United Nations General Assembly.
Several tweets about the phone conversation were posted to Rouhani's account, the first of which said: "In a phone conversation b/w #Iranian & #US Presidents just now: @HassanRouhani: "Have a Nice Day!" @BarackObama: "Thank you. Khodahafez."
Another tweet from Rouhani's account served an apology to New Yorkers who were stuck on traffic as world leaders headed out of town.
Rouhani, who is new to the presidency, has recently shown a willingness to work with Mr. Obama, even though his country has not made concrete steps to fulfill the preconditions that Mr. Obama required for negotiations on the nuclear issue. The Iranians have long-held that they seek nuclear technology to provide energy, and not to build weapons.
Iranian and U.N. officials agreed to meet again Oct. 28 to continue talks on how to investigate suspicions that Iran worked secretly on trying to develop nuclear weapons. Tehran denies that it wants to build a weapon.
ABC News and the Associated Press contributed to this report.