Dec 29 (Reuters) - The U.S. oil rig count rose by about 42 percent by end-2017 compared to the corresponding period last year, as energy companies boosted spending amid a recovery in crude prices.

Drillers held the number of oil rigs steady for a second straight week at 747 in the week to Dec. 29. That was 222 more than the 525 rigs at the end of 2016, General Electric Co’s Baker Hughes Inc energy services firm said on Friday. RIG-OL-USA-BHI

The oil rig count, an early indicator of future output, remained unchanged in December after rising by 10 in November. It declined by 3 in the fourth quarter after falling by 6 in the third quarter.

U.S. oil prices closed above $60 a barrel for the first time since mid-2015 on the final trading day of the year, ending 2017 with a 12 percent gain spurred by strong demand and declining global inventories.

Oil prices had been boosted by signs the global crude glut that has dogged the market since 2014 is shrinking, as a year of production cuts led by Middle East-dominated Organization of the Petroleum Exporting Countries (OPEC) and Russia helped tighten the market.

OPEC cuts kicked off last January and are scheduled to continue throughout 2018.

In 2017, U.S. crude futures have averaged about $51 a barrel, easily topping last year’s $43.47 average.

Looking ahead, futures were trading at about $59 for the balance of 2018 and $56 for calendar 2019.

In anticipation of higher prices in coming years, U.S. financial services firm Cowen & Co said 21 of the roughly 65 E&Ps they track have already provided capital expenditure guidance for 2018 indicating a 13 percent increase in planned spending over 2017.

Cowen, which has its own U.S. rig count, said it expects a gradual decline in the count in 2018.

There were 929 oil and natural gas rigs active on Dec. 29, up 41 percent from the 658 at the end of 2016.

The average number of rigs in service in 2017 was 876. That compares with 509 in 2016 and 978 in 2015. Most rigs produce both oil and gas.

U.S. crude oil production in October hit the highest in more than 46 years, rising by 167,000 barrels per day (bpd) to 9.64 million bpd, U.S. Energy Information Administration’s monthly production report on Friday.

If the figure is not revised next month, it would be the highest monthly level since May 1971. (Reporting by Vijaykumar Vedala in Bengaluru; Editing by Meredith Mazzilli)