BAGHDAD — The turmoil in Iraq is endangering the country’s revival into a leading oil producer and continued disruption would further spike global oil prices and raise gasoline costs in America.

The chaos has sent oil prices rising, as government forces and militants battle over the country’s largest refinery. Iraq’s big oil fields, which account for at least 75 percent of Iraq’s production of 3.4 million barrels a day, are far from the fighting, but there are fears that the fractured nation could struggle to help meet future world demand.

The U.S. imports only about 300,000 barrels a day from Iraq, but the motor club AAA, which monitors gasoline prices, says U.S. drivers are seeing an impact at the pump, and that what happens in Iraq will influence the summer driving season.

“AAA has predicted that drivers will pay relatively high prices this summer, ranging from $3.55-$3.70 per gallon. However, this range may be higher if unrest in Iraq escalates or disrupts oil production in the region,” the auto club said in a statement on the crisis.

Unlimited Digital Access. $1 for 4 weeks.

The heart of Iraq’s oil industry is in the mainly Shiite south, which so far has been spared this month’s advance by militants led by the al-Qaida spinoff group known as the Islamic State of Iraq and Syria (ISIS).

Northern oil fields imperiled by the militants’ advance have been shut down, and companies have begun evacuating workers elsewhere in the country. Iraq’s Kurdish minority has moved to solidify control over the northern oil-rich city of Kirkuk and other disputed areas, weakening Baghdad’s claims to the energy riches buried beneath while bolstering the Kurds’ aspirations of greater autonomy.

A senior Iraqi oil official said Baghdad has lost at least 400,000 barrels a day because of production cuts at oil fields in Kirkuk and nearby towns. Authorities also have had to shut down the Beiji refinery, which has been the scene of fierce clashes. Authorities have only been able to produce 30,000 to 40,000 barrels a day from Kirkuk fields to feed a small refinery, the official said.

The Beiji refinery and a nearby power plant supply Iraq with a third of its refined fuel and nearly a tenth of its electricity, according to Barclays analysts.

A major export pipeline controlled by Baghdad that traverses restive Sunni-dominated areas of northern Iraq was shut down earlier this year due to terrorist attacks.

So far, the Kurds have not approached Kirkuk’s oil fields or tried to pump oil through an independent export pipeline through Turkey that they built late last year, the oil official said.

But their advance has left them “much more well-positioned to retain full control of the contested territories,” including Kirkuk, said Ayham Kamel, Middle East and North Africa director at Eurasia Group in London.

“The new reality embodies Kurdish aspirations and withdrawing from all of these territories is close to impossible,” Kamel said.

Kirkuk, 180 miles north of Baghdad, is home to Arabs, Kurds and Turkmen, who all have competing claims to the area. Kurds have long wanted to incorporate it into their largely autonomous region, but Arabs and Turkmen are opposed.

In the 1970s and 1980s the Arab-dominated government in Baghdad drove hundreds of thousands of Kurds out of Kirkuk and nearby regions, settling Arabs from the south in their place in an attempt to pacify a region that had seen repeated revolts.

With an eye on statehood, the Kurds appear to be gearing up for a conflict with Baghdad on the issue. The prime minister of the Kurdish region, Nechervan Barzani, recently said there “is no way to go back to pre-Mosul Iraq” and that any political compromise must take into consideration the reality on the ground.

Down south, where Iraq’s main oil facilities are concentrated far from militant-held territory, oil companies, including Exxon Mobil and BP, have evacuated foreign employees from some major fields, another senior Iraqi oil official said. The move has not affected the production from the safer southern fields yet, but “it is a worrying sign for us,” the official added.

Both oil officials spoke on condition of anonymity as they were not authorized to brief media outlets.

Exxon and BP both declined to comment.

Earlier this year, Angola’s Sonangol decided to abandon two small oil fields it won rights to develop in 2009 outside Mosul due to security problems.

And a few days after the latest militants’ incursion, Korea’s state-run KOGAS delayed the development of a promising gas field in Iraq’s western Anbar province, near the border with Syria.

The Kurds have signed dozens of energy deals covering territory they control — contracts Baghdad deems illegal since it believes it has the sole authority to negotiate rights to drill on Iraqi territory.

Encouraged by what was then an improving security situation, Iraq in 2008 started to attract international oil companies to develop its vast untapped oil and gas reserves to bring in sorely needed cash for postwar reconstruction.

The country, which holds the world’s fourth-largest oil reserves of some 143.1 billion barrels, has since awarded more than a dozen oil and gas deals. Its daily production and exports have jumped to levels not seen since the late 1970s or early 1980s as a result.

Daily production earlier this year hit 3.5 million barrels, up from nearly 2.4 million a day in 2009, with the bulk coming from the south. Exports averaged nearly 2.6 million barrels a day last month.

Iraq hopes to reach 5 million to 6 million barrels per day in 2015 and envisions that figure rising to 9 million to 10 million barrels per day by 2020.

The Iraqi crisis comes as the global oil inventory is already stretched thin by unrest that’s halting production in Libya, Sudan and Nigeria, as well as sanctions on Iran and Syria and high demand for petroleum in China, according to firms that monitor the global petroleum markets.

Analysts said Iraq’s impressive oil revival, along with booming production in the U.S. and Canada, has provided an important source of supply.

“This Iraq issue kind of hit a market that was transitioning from, ‘We’ve got plenty of supply,’ to ‘Oh my gosh, we’re short,’ ” said Robert McNally, president of the Rapidan Group, an energy consulting firm.

Sen. Bernie Sanders, I-Vermont, said that speculators are using the Iraq crisis as an excuse to artificially drive up oil and gasoline prices.

“I am getting tired of big oil companies telling us that gasoline prices are going up because of the turmoil in Iraq,” Sanders said. “The truth is that big oil will never miss an opportunity to increase the price of gas. The fact is that high gasoline prices have less to do with supply and demand and more to do with Wall Street speculators driving prices up.”

Compiled from Bloomberg News, The Associated Press and McClatchy Washington Bureau reports.