By Catherine Ngai and Ernest Scheyder

NEW YORK/HOUSTON (Reuters) - In a corner of the prolific Bakken shale play in North Dakota, oil companies can now pump crude at a price almost as low as that enjoyed by OPEC giants Iran and Iraq.

Until a few years ago it was unprofitable to produce oil from shale in the United States. But the steep slide in costs has U.S. shale operators poised to capitalize on Wednesday's decision by the Organization of the Petroleum Exporting Countries to cap output for the first time in eight years. [nL8N1DV1UH]

In effect, even as OPEC has decided to reduce output to try to boost prices, that may end up being undermined by a potential increase in U.S. production.

OPEC ministers agreed to reduce production by around 1.2 million barrels per day, bringing an end to a free-for-all drilling era that saw global oil prices fall by more than half in the last two years.

In shale fields from Texas to North Dakota, production costs have roughly halved since 2014, when Saudi Arabia signaled a price war in an attempt to drive higher-cost shale producers out of the market.

Rather than killing the U.S. shale industry, the ensuing two-year price war made shale a stronger rival, even in the current low-price environment.

In Dunn County, North Dakota, there are around 2,000 square miles where the cost to produce Bakken shale is $15 a barrel and falling, according to Lynn Helms, head of the state's Department of Mineral Resources.

"The success in Dunn County has been fantastic," said Ron Ness, president of the North Dakota Petroleum Council.

Dunn County's cost is about the same as Iran's, and a little higher than Iraq's. Dunn County produces about 200,000 barrels of oil per day, about a fifth of daily production in the state.

It is North Dakota's sweet spot because it boasts the lowest costs in the state, yet improved technology and drilling techniques have boosted efficiency for the whole state and the entire U.S. oil industry.

The breakeven cost per barrel, on average, to produce Bakken shale at the wellhead has fallen to $29.44 in 2016 from $59.03 in 2014, according to consultancy Rystad Energy. It added that in terms of wellhead prices, Bakken is the most competitive of major U.S. shale plays.

Wood Mackenzie said technology advances should further reduce breakeven points.

Landlocked Bakken producers still need a substantially higher international price than their breakeven cost to make a profit, since they pay more to transport crude to market than producers in most other U.S. regions.

International oil prices of $45 a barrel are enough for some Bakken producers to profit, Ness said, and $55 would encourage production growth.

Benchmark Brent futures plummeted from nearly $116 a barrel in mid-2014 to just $27 earlier this year. Prices recovered to nearly $46 before the OPEC deal. That was still too low for members of the OPEC, whose state budgets depend on petrodollar revenues that plummeted during the price war.

OPEC has been concerned that an output cut would encourage a quick response from U.S. shale producers, who have slashed costs and have been steadily adding drilling rigs.

"Right now, OPEC understands we're in a push-and-pull experiment with the United States," said Michael Tran, director of energy strategy at RBC Capital Markets in New York.

"Two years ago, we thought prices hovering around $50 to $60 meant that non-OPEC production growth would end. But U.S. production came back stronger."

In its last earnings call, Hess Corp said it has improved its cost performance in the Bakken, with well costs falling and initial production rates rising, though it did not give more details.

"Everybody is drilling wells faster and completing them better," said Mike Breard, an energy stock analyst at Hodges Capital Management in Dallas. "It's not just a Bakken phenomenon."

Breard said he prefers shale stocks in the Permian basin in Texas, where he is expecting more big gains in production next year. He is eyeing firms such as Parsley Energy Inc, Ring Energy Inc and Matador Resources Co.

Oil companies are already investing big money to benefit from shale's resurgence. Tesoro Corp recently snapped up Western Refining Inc in a $4 billion deal to bulk up its exposure in Texas.

Separately, trading firm Castleton Commodities International LLC bought more than $1 billion in assets from Anadarko Petroleum Corp to increase its stake in East Texas.

Occidental Petroleum Corp's top executive recently said that company has enjoyed steady improvement in well productivity and lower drilling and completion costs in the Permian Basin.

"Simply put, we can deliver more production with fewer wells," Vicki Hollub, the company's president and chief executive, told analysts on a call.

(Additional reporting by Lewis Krauskopf in New York; editing by Simon Webb and Marguerita Choy)