TEHRAN — For more than a year, Iran’s president, Hassan Rouhani, had been walking a tightrope by trying to restore relations with the country’s archenemy, the United States. His hard-line opponents pelted him with eggs, but those who voted for him hoped for a possible thaw.

Rouhani, a Shiite cleric nicknamed the “diplomatic sheik” in Iran because of his skills in dealing with foreigners, even held a historic phone call with President Obama, later saying he found him polite and intelligent. Since then Rouhani has publicly pleaded to explore open discussions and at least some cooperation with the United States.

But Saturday, he struck a different tone, making him sound more like the conservatives who have long criticized him for being too soft on the United States.

Echoed Iranian view

In a news conference, Rouhani echoed the long-standing Iranian viewpoint that the United States can never be trusted.

He ruled out cooperating in the fight against regional terrorist groups such as the anti-Iranian Islamic State and hinted that U.S. actions were responsible for creating the group, as well as al-Qaida and the Taliban.

He criticized the United States for not taking action on the militants when Syrians were being killed, and only taking steps when it believed Americans and their interests were threatened. “Now they say: ‘We want to defend our embassy and consulate in Iraq.’ This is not fighting terrorism,” he said. “The Americans should be ashamed of their words.”

It is difficult to know if Rouhani’s statements — his toughest on the United States in a year — represent a shift in his thinking or are tailored to a domestic audience where hard-liners have been criticizing him harshly for months.

It is also possible the speech was a tactical move to strengthen Iran’s position before renewed talks on its nuclear program.

Rouhani’s statements came a day after the Obama administration imposed new sanctions on Iran, blacklisting 30 people and entities it said are linked to the country’s nuclear program.

U.S. strategy

The administration said the sanctions were a continuation of its strategy to crack down on groups suspected of seeking to avoid or violate existing sanctions, even as “the United States remains committed” to striking an accord by late November that includes “a long-term, comprehensive solution that provides confidence that Iran’s nuclear program is exclusively peaceful.”

But the sanctions appeared to upset Rouhani. “Yes, of course, we bypass the sanctions,” Rouhani said during his news conference. “We believe they are illegal and crimes against humanity.”

He added that for relations to improve, the United States must make the first move.

“Our people distrust Americans,” he said. “It would be better if Americans could do something that could help to build some trust in the future. Unfortunately, their moves only deepen distrust.”