TEHRAN  Iran has been making cars for more than half a century, becoming the top producer in the Middle East. The distinctive Paykan, first produced in 1967, remains an enduring source of national pride.

Just two years ago, Iran was producing 1.65 million cars a year, with exports to Syria, Iraq and Venezuela. Even the "Happy Birthday" song that Iranians sing to one another was first commissioned by Paykan manufacturers to celebrate the car's anniversary.

But if the car industry's rise has been stunning, so has been the crash.

This year alone, car production has plunged by 40 percent. From a rank of 13th in the world two years ago, it has fallen to 21st. And in the first half of 2013, the country shipped only 1,456 cars abroad  a tiny trickle compared with 2012.

The falloff reflects the crumbling of a key state-run Iranian industry, one that planners had hoped might one day help to diversify an economy that remains highly dependent on energy. As government employees, autoworkers enjoy job protection, but their factories now lie increasingly idle.

Measures implemented by the United States in July that imposed sanctions specifically aimed at Iran's auto production have been a driving factor in the collapse. The sanctions, part of a mounting international pressure aimed at Iran's nuclear program, have prevented Iran from importing parts such as pistons and cylinder heads that its domestically produced cars still rely on.

Ultimately, said Dariush Bozorgmehri, a University of California sociologist who travels to Iran to conduct research on the country's car industry, prospects for recovery "do not have a chance until the sanctions are lifted."

Executives at Iran Khodro, the country's top car producer, and at other manufacturers declined requests to be interviewed for this article. But they complained that sanctions targeting the auto industry only hurt the Iranian people, citing the 700,000 Iranians  some 4 percent of the workforce  who work in the car industry.

The Paykan, a replica of the British-made Hillman Hunter, dominated Iran's auto sales for years, even after the 1979 revolution when the Iran National car company was nationalized, becoming Iran Khodro. The birthday song  "Tavolodet Mobarrak," or "Happy Birthday"  was commissioned in 1970 to celebrate the car's fourth anniversary of production.

More recently, as competitors entered the field, Iranian companies have embarked on joint ventures with foreign manufacturers such as French carmakers Renault and Peugeot and the South Korean Kia, bringing exponential growth to the industry and adding momentum to its hopes to become a major exporter.

Today the streets and highways of Tehran remain packed with domestically manufactured cars that make up the bulk of the capital's infamous traffic, offering a glimpse of the expanded purchasing power that many Iranians enjoyed during the oil boom of the last decade.

As a society, Iran has always put a premium on technological know-how, and the auto industry helped to lay the groundwork for more ambitious projects, such as Iran's emerging space program and its disputed nuclear one, which Iran says is aimed at energy production but is regarded by its foes as an effort to develop nuclear weapons.

A boom in domestic demand and growing exports brought huge increases in Iran's car production beginning in 2000, and output increased nearly sixfold over the next decade.

But the plunge of the past two years means that Iran now lags behind Turkey as the top vehicle producer in the region, though it remains the No. 1 producer of passenger cars.

The blow has been particularly staggering in terms of exports, which had doubled between 2011 and 2012 to reach some 50,000 cars, almost all of them to Iraq, Syria and Venezuela, which rank among the country's few close allies.

On Saturday, Iran Khodro announced plans to begin selling cars to Russia at a rate of 10,000 per year. Although the statement offered no details on when the shipments would start, it was the first piece of good news for Iranian car exporters in an otherwise dismal year.

Manufacturers had begun to hope that, by the end of this decade, car exports might finally outrank Persian rugs and pistachios as Iran's top non-oil exports. But those hopes have begun to evaporate; for now, oil and gas still account for 80 percent and about 4 percent, respectively, of Iran's export revenue  even though Iran's ability to sell those goods is also hobbled by international sanctions. And while autoworkers have not been laid off, experts say that the continued need to pay their wages and benefits has become a major drag on Iran's already weakened economy, experts say.

Iran's new president, Hassan Rouhani, was elected to office in June in large part because of public anger over such economic distress. Rouhani has pledged to find ways to increase domestic production of non-oil goods such as cars, but analysts say it is clear that Iran's woes are tied to years of diplomatic and economic isolation.

"The only challenges are political. If carmakers could merge themselves into global markets, there is no other problem as they have the required technology and resources," said Saeed Laylaz, an Iranian economist.