By John Kemp

LONDON, April 26 (Reuters) - U.S. oil and gas drilling costs have started to rise in response to a surge in activity and are set to increase further as the slack in the rig market declines.

Drilling costs increased by 7 percent between November 2016 and March 2017, according to preliminary data on producer prices from the U.S. Bureau of Labor Statistics.

The increase has offset only a small part of the 34 percent slump between March 2014 and November 2016.

But it is the first sustained gain in three years for drilling prices, which are now rising year-on-year for the first time since November 2014.

Drilling prices are classified under the North American Industry Classification System (NAICS) code 213111 for "establishments primarily engaged in drilling oil and gas wells for others on a contract or fee basis".

Drilling prices do not include the cost of hydraulic fracturing, which is classified separately under NAICS code 213112, and where the previous decline in prices and subsequent recovery have been more muted.

Drilling costs have a strong cyclical component and track changes in drilling activity with an average lag of two to three months.

The number of rigs drilling for oil and gas hit a cyclical low at the end of May 2016 but has more than doubled since then ( http://tmsnrt.rs/2oLo37c ).

The rebound is the fastest for at least a quarter of a century, according to rig counts published by oilfield services company Baker Hughes.

The number of active rigs has risen from a low of 404 at the end of May 2016 to 857 on April 21 and is still gaining by an average of 10-20 per week.

Drilling prices will likely keep rising in the next few months as the lagged effect of past increases in the rig count filters through and rigs continue to be added.

Cost inflation for drilling as well as other inputs into the exploration and production process will likely put upward pressure on break even prices for U.S. shale firms.

Many shale producers report breakeven costs significantly below $50 per barrel but those costs are likely to rise as service companies push through price increases.

Service companies have repeatedly warned that the severe cost compression that occurred between 2014 and 2016 was unsustainable, and drilling costs would need to rise during any sustained recovery.

So far, the rise in drilling prices has been limited because of the large overhang of rigs stacked and crews idled during the downturn, which have limited the pricing power of drilling companies.

But as more of the drilling fleet is reactivated, drilling companies are likely to regain some power to push through price increases onto their customers.

"While the onshore rig count increase in North America has been more robust than many had expected, the industry is still working to absorb excess service capacity," Baker Hughes BHI.N told investors on Tuesday.

"As this capacity is being consumed, we have seen labour and materials cost inflation in select product lines and basins," the company wrote in its first-quarter earnings release.

"With the demand growth we experienced this quarter, we believe we are on the cusp of a broader pricing recovery." ("Baker Hughes announces first-quarter results," Baker Hughes, April 25.)

(Editing by Dale Hudson) ((john.kemp@tr.com; +44 207 542 9726 and on twitter @JKempEnergy))