U.S. energy companies this week cut oil rigs for the first time in seven weeks even as crude prices hovered near a three-year high, prompting more drillers to boost spending plans for 2018.

Drillers cut four oil rigs in the week to March 9, bringing the total count down to 796, Baker Hughes, a GE company (NYSE: BHGE), said in its weekly report. The U.S. rig count, an early indicator of future output, is much higher than a year ago when 617 rigs were active as energy companies have continued to boost spending since mid-2016 when crude prices began recovering from a two-year crash.

However, the number of gas-directed rigs jumped by seven to 188, compared to 151 a year ago, according to the report.

U.S. crude futures traded around $62 per barrel this week, close to levels hit in late January when prices rose to their highest since December 2014. That compares with averages of $50.85 in 2017 and $43.47 in 2016. Looking ahead, futures were trading around $61 for the balance of 2018 and $57 for calendar 2019.

In anticipation of higher prices in 2018 than 2017, U.S. financial services firm Cowen & Co. said 58 of the roughly 65 E&P companies they track have already provided capex guidance indicating an 11% increase in planned spending over 2017.

Cowen said those E&Ps that have reported spending plans for 2018 expected to spend a total of $80.5 billion in 2018, up from an estimated $72.4 billion in 2017.

Analysts at Simmons & Co., energy specialists at U.S. investment bank Piper Jaffray, last week forecast the total oil and natural gas rig count would average 1,015 in 2018 and 1,128 in 2019.

So far this year, the total number of oil and natural gas rigs active in the U.S. has averaged 959. That compares with an average of 876 rigs operating in 2017, 509 in 2016 and 978 in 2015. Most rigs produce both oil and gas.

For the year, EIA projected in March that total U.S. production will rise to a record high 10.7 million barrels per day (MMbbl/d) in 2018 and 11.3 MMbbl/d in 2019, up from 9.3 MMbbl/d in 2017. The current all-time U.S. output annual peak was in 1970 at 9.6 MMbbl/d, according to federal energy data.