In a major new study published last week, the International Energy Agency reconfirmed what Washington has long suspected: Iraq has the potential to reshape the global energy landscape in the years ahead, thanks to its huge untapped oil reserves. But whether Baghdad can capitalize on this opportunity is far from clear. The stakes are high—both for the global economy and the country's future.

Despite decades of turmoil and bloodshed, Iraq is already one of the world's major oil suppliers. The roughly 3 million barrels a day it pumps make it the world's third-largest exporter. Consider that Iran, hobbled by Western sanctions, is only producing half as much oil today as Iraq, whose wells are putting out more than twice what they did in 2003, the year of the Iraq War.

Yet by the 2030s, according to the IEA, Iraq may double its current output, leapfrogging energy-powerhouse Russia as the second-largest oil exporter in the world. This is hardly a far-fetched forecast. The country's proven oil reserves are the fifth largest in the world, its proven gas reserves the thirteenth largest. Its actual rank is likely far higher.

In comparison to other major oil producing countries, Iraq is still uncharted territory. Much of its geology remains little known and may well hold significant additional amounts of oil. A good part of what has been explored, at least outside of the Kurdistan area, happened prior to 1962. Today's vastly better technology and higher oil prices almost certainly mean that sizeable new reserves will soon be discovered.

Getting this oil in the ground to market will not be easy, though. Iraqi leadership will need to remove several roadblocks. The first is infrastructure. As it stands, essential hardware like pipelines and export terminals are inadequate to transport much more oil to tankers waiting offshore. Political improvements will also be required, such as building up the country's regulatory framework and legal processes. Some problems are simply logistical. Coordinating the efforts of a vast team of publicly traded Western oil companies, state-owned firms, Iraqi bureaucrats, and countless service providers will be essential. And on top of it all, security challenges loom large. Though the incidence of violence in the country has fallen markedly over the last five years, energy personnel and vital infrastructural will need protection for Iraq to ramp up its oil and gas industry.

The economic windfall the country could reap from an energy boom is substantial. The IEA estimates that oil exports could add a cumulative $5 trillion to its economy over the next 20 years, a godsend the agency calls a "transformative opportunity." The results could be impressive. The country's gross domestic product (GDP) would be five times what it is now if this growth materializes. Per capita, the Iraqi economy of 2035 would be roughly on par with where Brazil is now.

Yet there are risks. Oil revenues can cause a country more problems than they solve. If not properly reinvested, black gold can wreak havoc on other parts of a nation's economy, feed corruption and militarism, and leave a country painfully vulnerable to sudden fluctuations in commodity prices. A thriving oil and gas industry, by itself, will not be nearly enough to provide jobs to the country's growing population; other sectors must also become competitive. Moreover, unless the Iraqi government can tackle the host of above ground issues plaguing its energy industry, the riches that lie below ground may be very slow to arrive.

If Iraq can ramp up its oil production, American consumers will be among the winners. A dramatic rise in US oil production over the last five years has made a significant contribution to global supplies, but Iraq will likely be the single biggest source of new oil over the next two decades. The Middle Eastern country's oil will be crucial for feeding growing global demand. Iraqi export levels are likely to play a decisive role in whether oil supplies will be enough to keep a lid on prices. If Baghdad disappoints, Americans will feel it at the gas pump.

Iraq is in a unique position to help take the edge off a global oil market under serious strain. Time will tell whether the country will achieve its lofty goals—or if they will remain a mirage.

Blake Clayton is a fellow for energy at the Council on Foreign Relations in New York.