U.S. energy companies this week cut oil rigs for the first time in six weeks in spite of prices rising close to their highest in over two years and drillers starting to boost spending plans for next year.

The oil rig count fell by four to 747 in the week to Dec. 15, Baker Hughes, a GE company, said in its weekly rig count report.

The U.S. rig count, an early indicator of future output, is still much higher than a year ago when only 510 rigs were active after energy companies boosted spending plans for 2017 as crude started recovering from a two-year price crash.

The increase in U.S. drilling lasted 14 months before briefly stalling in August, September and October as some producers trimmed their 2017 spending plans after prices turned softer over the summer. Energy firms started adding rigs again in November as crude prices rose.

So far in 2017, U.S. crude futures have averaged over $50 per barrel, easily topping last year’s $43.47 average. This week, futures traded around $57 per barrel, near their highest since June 2015. Looking ahead, futures were trading near $56 for calendar 2018 and $54 for calendar 2019.

Financiers keep pouring cash into the shale oil sector, providing producers with a path to keep U.S. output rising through the middle of the next decade.

In anticipation of higher prices than in 2016, E&P companies increased their spending on U.S. drilling and completions in 2017 by about 53% over 2016, according to U.S. financial services firm Cowen & Co.

Cowen said 19 of the roughly 65 E&Ps they track, including EQT Corp., have already provided capex guidance for 2018 indicating a 13% increase in planned spending over 2017.

EQT said on Dec. 13 it expects to spend $2.4 billion in 2018, the majority of which will be to develop more wells in two key shale formations in the Appalachian region.

Cowen, which has its own U.S. rig count, said it was “intrigued by a sudden increase in rigs and will keep an eye on it” but for now still expects a gradual decline in the count in fourth-quarter 2017 and in 2018.

There were 930 oil and natural gas rigs active on Dec. 15, according to Baker Hughes. The average number of rigs in service so far in 2017 was 874. That compares with 509 in 2016 and 978 in 2015. Most rigs produce both oil and gas.

U.S. production is expected to rise to 9.2 million barrels per day (MMbbl/d) in 2017 and an all-time high of 10 MMbbl/d in 2018 from 8.9 MMbbl/d in 2016, according to a federal energy projection in December.

U.S. output peaked on an annual basis at 9.6 MMbbl/d in 1970, according to federal energy data.