For years it was assumed that economic sanctions and diplomacy would produce a pliable negotiating partner in Iran. But Iran’s truculence has effectively undermined the once-popular notion, while a degree of confusion and consternation has gripped the international community. The often-unstated hope is that denial of critical technologies and sabotage can slow the Islamic Republic’s nuclear program until, somehow, an alternative strategy, or an agreement, emerges. The thinking has been that time is on our side and that Iran’s weak scientific foundation can be further derailed through such pressure. Contrary to such presumptions, however, Iran’s scientific infrastructure has grown in sophistication and capability in the past two decades.

Iran is an outlier in the history of proliferation; nearly every middle power that obtained the bomb has had substantial assistance from an external patron. China acquired from the Soviet Union not just technical advice but also the means of building a nuclear reactor, weapon designs and a supply of ballistic missiles. China in turn provided Pakistan sufficient enriched uranium for two bombs, helped with the construction of its enrichment facility and plutonium reactors, and furnished bomb designs. Israel received from France a nuclear reactor, an underground plutonium reprocessing plant and weapon designs. India, which has long claimed its nuclear program as an indigenous accomplishment, conveniently leaves out the fact that it received a nuclear reactor from Canada and 20 tons of heavy water from the United States. Isolated and ostracized, South Africa came closest to Iran’s predicament, as it had to rely largely on internal resources for constructing the bomb; but it did receive from Israel tritium, which is critical for the explosion of thermonuclear weapons.

Although Iran received Russian assistance for completion of a light-water reactor that cannot be misused for weapons purposes, and, more ominously, rudimentary centrifuges from the A.Q. Khan network, Tehran never enjoyed the type of external patronage that other proliferators garnered. Moreover, no other state has confronted such systematic attempts to place stress on its nuclear program through denial of technology and computer virus penetration. (Indeed, if Pakistan and Israel had faced the obstacles confronting Iran, their paths to the bomb would have taken much longer.) That Iran has crossed successive technical thresholds, has managed to sustain an elaborate and growing enrichment network, and is about to unveil a new generation of centrifuges are all indications of its scientific acumen.

What made this possible? The 1980s were a calamitous decade for science in Iran as a revolutionary assault on the universities and the prolonged war with Iraq deprived the educational sector of funds and state support. But this changed in the 1990s, despite sanctions and export controls that were imposed on Iran after the 1979 revolution, as the political elite — conservatives and reformers — sought to revive scientific research. New organizations such as the Zanjan Institute for Advanced Studies in Basic Sciences and the Institute for Theoretical Physics and Mathematics were created; old institutions such as Sharif University of Technology were revived. The Atomic Energy Organization, which was protected by Hashemi Rafsanjani even in the heady days of revolutionary turmoil, enjoyed a new management team and greater state allocations. In a country where politics is often a blood sport, reformers and reactionaries have found common ground in their commitment to scientific development. The results have been impressive: The number of scientific papers produced by Iranian scholars in internationally recognized journals has increased dramatically, while many universities have sufficient resources and faculty expertise to offer their own doctoral programs.

Rather than suffering shortfalls or inhibitions from curtailed funding as a result of sanctions, the state has proved a generous patron of sciences. Iran’s scientists have emerged as strong nationalists determined to transcend fractious politics and provide their country the full spectrum of technological discovery, including advances in nuclear science. Iran’s pariah status has ironically engendered an esprit de corps within its scientific community. Researchers resent being shunned by their international colleagues, are annoyed at being excluded from collaborative efforts with Western centers of learning and are angered at the targeted killing of their colleagues. In today’s Iran, rulers and scientists have crafted a national compact whereby the state provides the resources while the scientists furnish their expertise. A dedicated corps of scientific nationalists is committed to providing its country with the capacity to reach the height of technological achievement and, in the process, provide the mullahs with the means of building the bomb.

Exact estimates vary, but in the next few years Iran will be in position to detonate a nuclear device. An aggressive theocracy armed with the bomb will cast a dangerous shadow over the region’s political transition, but the consequences will not be limited to the Middle East. An Iranian bomb is likely to unleash the most divisive partisan discord in this country since the 1949 debate about who lost China. In the end, neither the turbulent order of the Middle East nor the partisan politics of Washington can afford an Islamic Republic armed with nuclear weapons.

The writer is a senior fellow at the Council on Foreign Relations.