In early June, Iran was at the apex of its power on the world stage. Aid to insurgents in Iraq, Afghanistan and Lebanon had helped convert Tehran into a regional superpower rivaled only by Israel. At home, hard-liners led by President Mahmoud Ahmadinejad had consolidated control of parliament, the judiciary and the military and marginalized reform parties.

This week, however, Iran heads into talks in Geneva with the U.S. and five other world powers more vulnerable at home and abroad than at any time since the revolution's chaotic early days. Despite defiant talk and a weekend display of military force, the world's only theocracy begins its most important diplomatic engagement in three decades in real trouble. (See international protests of Iran's election.)

Over the past four months, the Islamic Republic has faced two game changers. First, the June 12 presidential election spawned a vibrant new opposition movement, a political schism among the theocrats and popular protests that deeply undermined the hard-line regime's legitimacy among its constituents. Second, the gotcha revelation on Sept. 25 about a secret nuclear plant put Tehran on the defensive with both its enemies and allies  and undermined Ahmadinejad's U.N. media blitz, which had been designed to boost his post-election image. (See the top 10 Ahmadinejad-isms.)

Now those challenges are converging, tightening the squeeze on the regime. Over the weekend, Iran's new opposition chose sides in the nuclear debate  and sided with the world. "The Iranian Green Movement does not want a nuclear bomb, but instead desires peace for the world and democracy for Iran," said a statement issued by filmmaker and opposition spokesman Mohsen Makhmalbouf. "The Green Movement in Iran furthermore understands the world's concerns and in fact has similar concerns itself."

That's a first. In the past, Iranians rallied around even unpopular governments when confronted by the outside world. Iraq's 1980 invasion of Iran helped a young revolution already running out of steam consolidate its hold on power and survive eight years of the Middle East's deadliest modern conflict. Tehran's quest for nuclear energy, widely embraced as a key to development in the 21st century, has also long been a potent unifier of Iran's disparate political factions. Persian national pride has been a powerful force for millennia.

But the revelation of a hidden nuclear facility near the holy city of Qum that is run by Iran's élite Revolutionary Guards  and the threat of more sanctions if Tehran does not cooperate with the new U.S.-sponsored diplomatic initiative  appear to have deepened the political fissures rather than led Iranians to close ranks.

The critical unknown is whether the escalating pressures will lead the theocracy to compromise or make it even more obstinate once it reaches the negotiating table.

The regime's response on Sunday was to flex its military muscle. To shouts of "Allahu akbar," the Revolutionary Guards test-fired short-range missiles to demonstrate that Iran has the necessary arsenal to defend itself. "We are going to respond to any military action in a crushing manner, and it doesn't make any difference which country or regime has launched the aggression," said General Hossein Salami, head of the Revolutionary Guard Air Force, according to Iran's state media. The tests were successful, with the short-range missiles hitting their targets, he said. (Read "Iran Standoff: Is a Nuclear-Free Middle East a Pipe Dream?")

Further tests of longer-range missiles are expected in the days running up to the historic meeting between American, French, British, Russian, Chinese and German diplomats and their Iranian counterparts.

Thumbing its nose at the world may not help, since even the skeptical Russians suggested last week that further sanctions may be in order if Iran does not come clean about the secret facility and other older questions about Tehran's nuclear program. "The Iranians are in a very bad spot now because of this deception, in terms of all of the great powers," Defense Secretary Robert Gates told ABC News on Sunday.

Just how bad will be determined after talks begin on Oct. 1 in Geneva's historic Hotel de Ville. "If we don't get the answers that we are expecting and the changes in behavior that we are looking for, then we will work with our partners to move for sanctions," Secretary of State Hillary Clinton told CBS on Sunday. "The burden has now shifted ... They have to come to this meeting on Oct. 1 and present convincing evidence as to the purpose of their nuclear program. We don't believe that they can present convincing evidence that it's only for peaceful purposes. But we are going to put them to the test."