BAGHDAD — Iraq’s crude oil exports increased slightly in May despite constant militant attacks that have left a vital oil pipeline idle, the Oil Ministry said Sunday.

The oil exports averaged 2.582 million barrels a day last month, an increase from the 2.510 million barrels per day in April, ministry spokesman Assem Jihad said. Jihad said the sales grossed $8.068 billion, based on an average price of $100.08 per barrel. April’s revenues stood at $7.582 billion.

He added that all the oil was exported through the country’s facilities on the Persian Gulf as the pipeline which goes to Turkey’s Mediterranean port of Ceyhan has been idle since March because of terrorist attacks. The pipeline, which pumps 300,000 to 400,000 barrels a day and traverses restive Sunni-dominated areas of northern Iraq, has been a favorite target for militants.

Iraq holds the world’s fourth largest oil reserves, some 143.1 billion barrels. Insurgent attacks, infrastructure bottlenecks and disputes with the northern self-ruled Kurdish region over rights to develop natural resources have been the main obstacles to Iraq increasing oil production and exports.

In 2009, the Kurds contributed oil officially from the first time through a Baghdad-controlled pipeline, but shipments were interrupted many times over payment disputes. Last month, the dispute took a new turn when the region decided to unilaterally export oil through an independent pipeline.

Baghdad has called the move “smuggling” and “robbery” and has filed a request for arbitration against Turkey, vowing a lawsuit against the Kurdish regional authorities as well as the traders and the buyers.

On Sunday, the Oil Ministry renewed its warning to potential buyers of the nearly 1.05 million barrels still loaded on a vessel called the United Leadership, which left Turkey on May 22.

“The Oil Ministry considers the oil loaded on the mentioned vessel stolen and smuggled,” the statement said. “Any party or oil company that deal with or market the cargo of the vessel will face legal action.”

Iraq has been struggling to develop its oil and gas sectors since the 2003 U.S.-led invasion, when deteriorating security scared many investors away. Daily oil production and exports have climbed steadily since 2011, nearly two years after Iraq awarded rights to develop its major oil fields to international oil companies. Oil revenues make up nearly 95 percent of Iraq’s budget.