Iraq has overtaken Iran as the second-largest OPEC oil producer for the first time since the late 1980s, a symbolic shift that signals the huge impact of Western sanctions on Tehran and the steady recovery of Baghdad’s energy industry.

The International Energy Agency, the Western countries’ oil watchdog, said Friday that Iraq last month produced more than 3 million barrels a day, the highest output since the U.S.-led invasion nearly a decade ago. At the same time, Iranian oil output fell below the 3 million-barrel-a-day level for the first time in more than 20 years, dropping to 2.9 million a day in July.

Last month was the first that saw the combined impact of U.S. sanctions against Tehran, a full E.U. embargo on the country’s crude exports and a de facto global ban on maritime insurance for Iranian oil supertankers. “The different [production] paths show the huge impact of politics in oil and the Middle East,” Manouchehr Takin, an oil analyst at the Center for Global Energy Studies, said.

Industry executives, analysts and policymakers said that although Iraq had made strong progress boosting its output, the drop in Iranian production was the main factor behind the switch in the production ranking. Over the past five years, Iranian oil production has fallen roughly 1 million barrels a day because of the impact of several rounds of sanctions and under-investment, while Iraqi output has surged 800,000 barrels a day.

The gap is likely to widen as Iraq continues to rebuild its hydrocarbon industry with the help of billion of dollars in investments from foreign oil companies and Iran faces further Western sanctions over its nuclear program.

Baghdad signed long-term contracts between late 2008 and early 2010 with oil groups including Exxon Mobil, Royal Dutch Shell, BP, Total of France, Lukoil of Russia and CNPC of China to develop a dozen gigantic fields in southern Iraq, including some of the world’s largest, such as Rumaila and West Qurna.

Iraq has set an ambitious target of pumping 12 million barrels a day by 2017, but officials and industry executives have said they believe it will achieve only a fraction of that level.

“The most likely scenario is that production rises from 3 million barrels a day now to about 4 to 4.5 million barrels a day,” said Takin, a geologist by training and former official at the Organization of the Petroleum Exporting Countries, echoing a view widely held by oil companies investing in Iraq.

Gati al-Jebouri, the head of Lukoil in the Middle East, last year suggested a target of about 5 million barrels a day but cautioned that output depends on pipeline infrastructure.

In addition, big oil companies such as Gazprom of Russia and Chevron of the United States have also signed deals with the semiautonomous region of Kurdistan, in northern Iraq, to tap smaller but lucrative oil fields there. The deals have soured the relationship between Baghdad and Irbil, the capital of the Kurdistan region. But the tension, so far, has not seriously hurt the development of the industry.

The recovery of Iraqi oil production has slowed in the past two years, partly because of infrastructure bottlenecks, such as the lack of sufficient pipeline capacity and export terminals to ship the oil from the fields to supertankers in the Gulf. Earlier this year, Iraq installed new pipelines and opened two terminals that have nearly doubled its export capacity in the south to 3 million barrels a day.

The country still faces enormous security challenges. Only this month, two bombs damaged a critical pipeline carrying crude oil from the northern city of Kirkuk to the Turkish port of Ceyhan in the Mediterranean. International oil companies remain wary of sending foreign workers to Iraq.

The sharp drop in Iranian output comes amid heightened diplomatic tensions over the its nuclear program. Tehran and Western powers have failed to bridge their differences in high-level talks over the past three months. Washington and its European allies hoped the oil sanctions would force Tehran to yield in the negotiations to avoid further economic damage. Oil exports provide half of the Iranian government’s revenues and account for 80 percent of the country’s total exports, according to the U.S. Department of Energy.

Increased production translates into billions of dollars in hydrocarbons revenue. According to the Energy Department, Iran made $95 billion last year selling its crude oil, compared with the $71 billion made by Iraq. But in the first four months of the year, both countries pocketed almost the same amount — $22 billion and $24 billion respectively — as oil production levels converged. By December, analysts say, Iraq will have earned more in oil sales than Iran for the first time since Saddam Hussein invaded Kuwait in 1990.

— Financial Times