But Rouhani added that should Iran and the five permanent members of the UN Security Council plus Germany not strike a deal next month, the process will continue until all differences are resolved.
"We are serious in the negotiations, and it will be in the interest of everyone if a deal is signed in the next five weeks," the Iranian president told a press meet in Tehran.
More From This Section
"But there are differences, and in some issues the gaps are substantial," he said.
The P5+1 (Britain, China, France, Russia, the United States plus Germany) talks with Iran resume in Vienna on Monday with the aim of transforming an interim deal into a lasting accord.
The West wants to ensure that Iran's nuclear activities are purely peaceful. In return, Iran wants the removal of international sanctions that have choked its economy.
Details of the negotiations have been scant but according to French Foreign Minister Laurent Fabius, Iran wants to operate thousands of centrifuges, machines used to enrich uranium to fuel nuclear plants but which could also provide fissile material for an atomic bomb.
The P5+1 wants Iran to drastically reduce its uranium production capacity, and keep only a few hundred centrifuges active.
"If there is no deal (before July 20), then we will continue the talks... Until we reach an agreement," Rouhani said, while suggesting that work on a draft agreement could begin in Vienna.
Rouhani's remarks came a day after his lead negotiator and foreign minister, Mohammad Javad Zarif, warned critics not to let "illusions" about his country's nuclear programme scuttle a deal.
In Tehran, Rouhani and Zarif appear to have reined in hardline and conservative critics who are opposed to any compromise on what they call Iran's "right" to operate a civilian nuclear programme.
Against that backdrop, Rouhani today suggested if the talks collapse, the burden would be on "hardliners in America and the Zionist regime" who are against any deal that allows Iran to keep even a limited nuclear drive.