Jolted by the swift collapse of Saddam Hussein's regime in Iraq, the hardline clerics who rule Iran have been cracking down on dissent at home and talking discreetly to US diplomats abroad in an effort to stave off American pressure.
With US troops and military bases now virtually surrounding Iran, the conservative leaders have broken an old taboo by talking to their arch-enemy in an attempt to buy some breathing room and pre-empt possible US military action.
Although the two countries have not had diplomatic relations since the US-backed Shah was overthrown in 1979, officials on both sides have acknowledged a series of contacts between Washington and Tehran in recent weeks.
The US secretary of state, Colin Powell, said over the weekend that a resumption of diplomatic relations was not on the table, but added that the governments were speaking "in light of the changed strategic situation".
The new "situation" has put Iran in a vice. In the past 18 months, the US military machine has toppled two regimes on Iran's borders, Afghanistan and Iraq, with relative ease.
As Washington turns its attention to Iran's nuclear program, the conservative establishment in Tehran is clearly rattled.
After the fall of Baghdad last month, the supreme leader, Ayatollah Ali Khamenei, sounded frustrated that Iraqi troops had failed to put up more resistance against US forces, calling their surrender "an eternal disgrace".
One former member of the establishment, who has become its most prominent critic, dared to say in public what many reformists were saying privately. Ayatollah Hosein Ali Montazeri said the clerical leadership could face the same fate as Saddam if it continued its autocratic ways.
"On this solemn and dangerous occasion, I warn leaders and officials of the Islamic republic to learn from the sad experience of the Iraqi dictator and hear the cry of the Iranian people for justice and democracy," he said.
The hardliners, who have blocked attempts at reform by President Mohammad Khatami and his allies in parliament, have drawn a different lesson from the Iraq conflict. Citing the US threat, they are moving against their political opponents and restricting public debate.
Proposals from President Khatami to end the obstruction of parliament and halt political trials have been stalled and then vetoed.
In recent weeks the judiciary and security services have targeted independent journalists who turned to the internet after their newspapers were shut down, subjecting them to detention without trial and interrogation.
The hardliners have handpicked ultra-conservatives to serve in key positions in the judiciary and in Tehran's city government.
Last week, officials announced plans to restrict access to "unethical"Web sites. There are now fears that the authorities will move against the country's award-winning film industry following the detention of several film critics and screen writers.
Earlier this month, Ayatollah Khamenei's representative in the militant Revolutionary Guard put MPs on notice that their comments would be "monitored" to safeguard national security, a clear message aimed at intimidating reformists, who form a majority in parliament.
In the past, reformist MPs have threatened to resign if the hardliners in the Guardian Council and the judiciary continue to veto legislation and punish dissidents. But they now run the risk of being accused of imperilling national security and playing into the hands of the "enemy" next door in Iraq.