Dealmaking across the U.S. oil and natural gas sector, particularly in the onshore, has begun 2017 “with a green flag and a full tank of gas,” following a surge in activity during the fourth quarter, PwC researchers said Tuesday.

Last year’s dealmaking began slowly but it gained velocity through the year, with volumes in the final three months 49% higher sequentially and 168% above levels in 4Q2015.Enthusiasm built as commodity prices began to recover, with merger and acquisition (M&A) activity awakening in 3Q2016. It’s been in high gear since.

“Despite a timid start in the first quarter, 2016 oil and gas M&A ended on a high note, mimicking increased optimism for the overall oil and gas sector,” said PwC’s Doug Meier, U.S. oil and gas sector deals leader. “We expect this optimism, and corresponding increase in risk tolerance, to carry over into 2017 resulting in strong M&A activity,” along with an acceleration in initial public offerings (IPO).

Confidence across the M&A sector appears to be driven in part by an agreement — through at least May — by the Organization of the Petroleum Exporting Countries and allies to curtail global oil production. Investors also appear enthused by Donald Trump’s election, which “many industry players presume will be favorably disposed to business in general and the oil and gas industry in particular.”

President Trump’s cabinet nominees include former ExxonMobil Corp. CEO Rex Tillerson to become secretary of state, while oil and gas industry cheerleader and former Texas Gov. Rick Perry would lead the Department of Energy. Oklahoma Attorney General Scott Pruitt, considered an industry ally, has been nominated to run the U.S. Environmental Protection Agency. On Tuesday the president also signed executive orders to advance construction of the long-delayed Keystone XL and Dakota Access oil pipelines, citing their potential for more jobs and revenue.

The value of oil and gas dealmaking in 2016 totaled $195.7 billion, which was 0.2% lower than in 2015, according to PwC. However, volume rose 11% from 2015 to 198 deals. Upstream deal value rose 111% in 2016, with volume increasing 53%.

“Deals in the upstream space contributed 60% of the total deal volume, and 33% of the total deal value in 2016 versus 44% and 16% in the prior year,” PwC said. Midstream value declined 35% in 2016, but deals still totaled $84 billion. Midstream deals value in 4Q2016 alone rose 195% higher year/year.

Oilfield services finally revived in the fourth quarter, with the segment generating 10 transactions worth a total of $29.6 billion — the most active quarter since 4Q2014. At the same time, bankruptcies continued to decline.

Nearly half of the deals in the fourth quarter were “shale-related,” with strong demand in the Permian Basin, pushing multiples “to heights not seen since before the commodity downturn.” Higher demand also was in the offing for Marcellus Shale-focused deals. According to PwC calculations, 30 of the 61 transactions announced between October and December involved shale/unconventionals.

“Investors continue to show appetite for shale, with 30 of the 61 deals announced in the fourth quarter being shale-related,” PwC said. “Shale deal value reached $21 billion, a 166% year/year increase in deal value. Newly added rigs and improved production techniques continue to boost the attractiveness of shale in the U.S.

“However, in shale, location is key. With oil prices stabilizing, but still far off the $100/bbl heights of a couple of years ago, shale deals done in 2016 relied on the old real estate mantra: location, location, location.”

The Permian was the most active shale basin in 2016 with 24 deals valued at $13.8 billion, followed by the Marcellus Shale, with 13 worth $6.8 billion. The Eagle Ford Shale recorded nine transactions worth $2.4 billion, while there were six announced transactions in the Haynesville Shale worth $2.6 billion. Four Bakken Shale deals last year were worth $2.9 billion, while three Niobrara formation transactions totaled $3.3 billion.

Most of the U.S. oil and gas transactions came in the final quarter, with deal volumes 30% higher sequentially and 45% higher year/year. Deal value in the final period totaled $84.8 billion, which was 49% higher sequentially and 168% higher year/year.

Since the start of this year year, M&A has remained in high gear, PwC researchers said.

“There are finally signs of life in the oil patch,” said PwC’s Seenu Akunuri, oil and gas valuation practice leader. “Sustaining demand, the elections, OPEC agreement and an energy executive nominated as secretary of state have all given a boost to the industry.”

While “it is too early to tell of the long-term impact, these signs have had a positive impact on business and asset valuations,” Akunuri said. “The recovery in commodity prices gave companies a window of opportunity to arbitrage their rising share prices and fund acreage acquisitions, while private companies used the IPO market, and some of the distressed companies were able to emerge from bankruptcy. The activity in Permian in particular has given new hope to the U.S. shale industry and 2017 looks like a very promising year.”