SHANGHAI, China — Talks between Iran and six world powers on a comprehensive deal over its nuclear program are “very likely” to reach a successful conclusion by a July 20 deadline, Iranian President Hassan Rouhani said Thursday.

“The signs that we have been receiving in the last few days are telling us we are very likely to come to an agreement by the end of July,” Rouhani told reporters in Shanghai, speaking through a translator. “We can achieve this.”

Iran insists its nuclear technology activities are aimed at civilian use, while Western powers suspect its drive masks military objectives.

Rouhani’s comments came after an apparently largely fruitless fourth round of negotiations in Vienna last week.

But the UN atomic watchdog said Wednesday that Iran has agreed to address some of the many long-held allegations that it conducted research into making nuclear weapons before 2003 and possibly since.

The International Atomic Energy Agency said that Iran, which denies ever having sought nuclear weapons, has undertaken to implement “practical measures” by a separate deadline of August 25.

“It takes time” to resolve outstanding issues, Rouhani said a day after attending an Asian security forum in China’s commercial hub of Shanghai.

“We cannot expect it to be resolved in a few meetings.”

He did not specify problems in the talks with the five United Nations (UN) Security Council permanent members plus Germany — known as the P5+1 group.

But he said outstanding issues had been a “matter of contention for years,” suggesting they involved Iran’s nuclear program.

According to media reports, among those gaps are the scope of Iran’s enrichment of uranium, which if further purified could be used to trigger a nuclear explosion, and its unfinished Arak research reactor, whose by-product waste could provide an alternative route to an atomic bomb.

Rouhani criticized unnamed countries for acting slowly and creating obstacles in the nuclear talks.

“There are certain countries behind the scenes that want to create problems. If they are not given a chance to sabotage talks, then we have enough time to achieve the ultimate success,” he said.

But he also said the July 20 deadline could be extended if an agreement could not be reached in time.

“Let’s say we don’t come to an agreement by that deadline, we can extend that interim agreement by another six months,” he said.

Rouhani met Chinese President Xi Jinping for bilateral talks on Thursday. China is party to the nuclear talks as a permanent UN Security Council member.