VIENNA — With three Americans long held in Iran flying to Europe on Sunday, President Obama urged young Iranians to “pursue a new path” with the West as he imposed modest new sanctions on the country for banned missile tests.

The images of long-delayed freedom and Washington’s double-edged message underscored the uncertainties about the long-term implications of a dizzying 48 hours of diplomacy between Washington and Tehran that yielded a mutual prisoner release. It had hints of a budding era of détente. But there were clearly forces in both capitals arguing against any form of cooperation.

By the end of the weekend, the three Americans — a Washington Post reporter, a former Marine and a pastor — were at an American air base in Germany undergoing medical examinations, almost home after languishing in Iran’s worst prisons. The Iranians, for their part, were trying to adjust to a new world in which they were free to sell their oil around the world, but at prices far lower than they had anticipated, and to reconnect with a global financial system that had been closed off to them while they were expanding their nuclear infrastructure.