In the nearly three weeks since Mr. Trump’s inauguration, that feeling has completely dissipated.

At a barbershop in west Tehran, the Trump name was the only thing that could get a group of young men to turn away from the soccer match between Tehran’s popular Esteghlal team and a team from Qatar.

“We thought he was a businessman who would offer transactions with Iran, perhaps some investments,” said Ali Mohammadi, 26. Describing himself as a fun-loving young man seeking a decent job, Mr. Mohammadi said he was now thinking about what he would do if Iran came under bombardment someday. “It just feels as if we are powerless, at the mercy of international politics.”

When Mr. Trump started ridiculing the nuclear agreement during the presidential campaign, many in Iran thought he was merely trying to get votes.

Some middle-class Iranians, who get their news from the approximately 150 illegal Persian-language satellite channels that broadcast from overseas into Iran, started contending that Mr. Trump could actually be a blessing. His perceived friendliness toward Russia has long been seen as a plus in Iran, with many people expecting Russia’s president, Vladimir V. Putin, to rein in Mr. Trump’s anti-Iranian stances.

“But we cannot trust the Russians to do so,” said Housang Tale, a historian who is critical of Russia’s relationship with Iran’s leaders. “They have used us throughout history, taken our land and sold us out,” he said of Russia. “Who says they won’t trade Iran with the U.S. for the Ukraine? More pressure is coming.”

Others disagreed and insisted that Iran’s cordial relations with Russia would save their country from new sanctions and military strikes. “They will not allow America to attack us,” said Malek Elyasi, who owns a motorcycle repair shop. “Any war with Iran would turn into a global conflict because the Russians will support us.”

Iran’s defiance of the United States has been a pillar of foreign policy since the 1979 Islamic Revolution, and the ideology of independence from world powers is widely embraced even by Iranians who do not like their government’s politically repressive behavior. But some question whether this ideology can sometimes undermine national interests.