Oil and gas producers and the companies that service them foresee continuing upward momentum in 2017 as oil and gas prices stabilize, according to a survey released Thursday.

More than half of all firms responding to the quarterly Energy Survey by the Federal Reserve Bank of Dallas said activity surged in the fourth quarter, with 46 percent reporting rising capital expenditures. The numbers are a stark turnaround from the first quarter, when 56 percent of firms said business activity was decreasing and nearly 60 percent were cutting capital expenditures.

 Oil and gas production stopped falling in the fourth quarter after declining throughout the year, the Fed said. Respondents were more bullish than in the previous quarter about oil prices a year from now, but mixed on natural gas prices. 

 The Fed said 71 percent expect higher oil prices a year from now while 50 percent expect higher gas prices.

"The oil and gas sector is entering 2017 on a positive note, as activity continued growing in the fourth quarter and outlooks improved significantly," Dallas Fed senior economist Michael Plante said in a news release.

The Fed polled 147 energy firms, of which 67 were exploration and production companies and 80 were in oilfield services. The area surveyed is Texas, northern Louisiana and southern New Mexico.

 A majority of the survey's respondents said they did not believe a recent agreement by the Organization of Petroleum Exporting Countries and several non-OPEC countries to cut production would hold. But more than half increased their oil price forecasts and company outlooks for 2017 in response to the announced production cuts.

 About 44 percent of the executives who responded to the survey said they expect the global oil market to come into balance in the third quarter of 2017.