TEHRAN, Iran — Iran's top leader said Sunday he has not prohibited talks with the U.S. but urged caution with any possible dialogue, describing the American government as untrustworthy.

The U.S. and Iran are in deep disagreement over Tehran's nuclear program. The U.S. and the West have imposed punishing economic sanctions to press Iran to stop enrichment of uranium, fearing that the process could lead to production of nuclear weapons. Iran denies that intention.

"I said earlier this year that I'm not optimistic about talks with the U.S.," said Supreme Leader Ayatollah Ali Khamenei, "although I didn't prohibit dialogue on specific issues such as Iraq in the past years." He told outgoing President Mahmoud Ahmadinejad and other top government officials in Tehran, "Americans are untrustworthy and illogical. They are not honest in their dealings."

Iran's president-elect, Hasan Rouhani, has pledged to follow a path of moderation and interaction with the outside world. Khamenei said Iran must determine the goals of its adversaries. Otherwise it will suffer, he said.

"We've always believed and continue to believe in interaction with the world but the important point . is to understand the other party and determine its goals and tactics, because we will be tripped up if we don't understand them correctly," Khamenei said in comments posted on his website late Sunday.

"The art in interaction with the world is to continue your path without the other party being able to stop you. If interaction with the world causes retreat from the path, it is a loss," he said.

Rouhani, who won a landslide victory in the June 14 presidential election, will be sworn in Aug. 4. Iran has sent invitations to world leaders to attend his inauguration.

Rouhani's election has revived hopes for easing of tensions with the West as well as possible direct talks with the U.S.