Oct 16 (Reuters) - U.S. energy firms this week added the most oil and natural gas rigs since January as producers return to the wellpad with crude prices holding around $40 a barrel over the past several months.

The oil and gas rig count, an early indicator of future output, rose for the fifth week in a row, increasing 13 to 282 in the week to Oct. 16, energy services firm Baker Hughes Co said in its closely followed report on Friday.

The total rig count fell to a record low of 244 rigs during the week ended Aug. 14, while oil rigs alone fell to a 15-year low at 172 in the same week, according to Baker Hughes data going back to 1940.

U.S. oil rigs this week also posted their biggest build since January, rising 12 to 205 this week, their highest since June. Gas rigs rose one to 74, according to Baker Hughes data.

Most of the rigs added were in Texas, which gained seven. At least three of those units were in the Eagle Ford shale in South Texas, according to the data.

Even though U.S. oil prices are still down about 34% since the start of the year due to coronavirus demand destruction, U.S. crude futures have gained 116% over the past six months to about $41 a barrel on Friday mostly on hopes global economies and energy demand will return as governments lift more lockdowns.

Analysts said those higher oil prices have encouraged some energy firms to start drilling again.

"The horizontal activity trough is now indeed behind us, and we continue to expect to see further modest gains into year end 2020," analysts at Tudor, Pickering, Holt & Co said this week.

(Reporting by Scott DiSavino Editing by Marguerita Choy)