Before Islamist fighters seized much of northern Iraq, hopes that the recent era of stable oil prices would last rested heavily on the country. Its exports were expected to go on rising, providing lots of low-cost oil at a time when the depletion of mature fields elsewhere is beginning to bite into supplies.

The International Energy Agency had projected that Iraq's production would jump from 2.5 million barrels a day to 4.4 million in 2015 and nearly 6 million by 2020.

But as on so many occasions since 1980, war, sanctions and domestic upheaval have constrained the huge potential of OPEC's second-biggest producer. The chances of restarting exports from northern Iraq (via a pipeline crippled by sabotage in March), and of investment and modernization in the country's south, are looking slimmer by the day.

Fighting shut the Baiji refinery, Iraq's largest, last week. It produced 170,000 barrels a day of gasoline and other products. In addition to exports, it supplied northern Iraq and Baghdad, which now face shortages.

Though there is little chance that the Shia south, which produces 90 percent of Iraq's oil, will come under the control of the insurgents, sabotage and terrorism are more likely, as is political ­instability. Recovering from the previous bout of sectarian conflict, in 2006, took years. Nor is the news encouraging outsiders to invest in the new ­equipment that the badly run oil fields need.

A crumb of good news is that the semiautonomous Kurdish region of Iraq is trying to step up exports, with another two tankers due to be loaded at Ceyhan in Turkey this week, on top of two previous shipments this month. The Kurds have taken over the main oil town in the north, Kirkuk, and claim — confusingly — to have built a link from it to their own export pipeline in just a few days.

But buyers are twitchy: Iraq's central government says it will sue anyone involved in what it regards as illegal exports. Amrita Sen of Energy Aspects, a consultancy, says that for all their sympathy with the Kurdish territory, it is the priorities of outsiders that are keeping Iraq together.

The bad news from Iraq comes amid other woes. Exports from Syria, once nearly 400,000 barrels a day, have fallen almost to zero. Hopes that Libya, until recently a big oil producer, would restore production have shriveled. It returned to 1.5 million barrels a day quickly after the civil war of 2011, to the surprise of outsiders, but has now fallen back to less than 1 million. Fears are mounting, says Sen, that chaos and inactivity have seriously harmed Libya's already fragile oil fields. The longer Iraq's pumps stay idle, the greater the danger of damage there too.

For now, global stocks are strong and the main damage from events in Iraq is to expectations. The price of a barrel of Brent crude rose slightly as fighting intensified before steadying below $115. Saudi Arabia can pump more — up to 1 million barrels a day — and America could release crude from its Strategic Petroleum Reserve. But in the medium term the outlook is bleaker. Not everything has to go right to keep oil flowing in the quantities and prices that the industrialized world expects, but an awful lot is going wrong at once.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.