Exxon Mobil reported a 49% decline in third-quarter earnings on lower oil prices and higher costs. The results, however, did slightly top Wall Street expectations and the shares gained 3% in Friday's trading session.

Exxon earned $3.2 billion in the third quarter, down from $6.2 billion in the same period a year ago.

Here's how the energy giant's results fared relative to Wall Street expectations:

Adjusted earnings: 75 cents per share vs. 67 cents expected by Refinitiv

Revenue: $65.05 billion vs. $64.79 billion expected expected by Refinitiv

Upstream income: $2.17 billion vs. $2.36 billion expected from FactSet estimates

Downstream income: $1.23 billion vs. $1 billion expected from FactSet estimates

Chemicals income: $241 million vs. $223.6 million expected from FactSet estimates

The company spent $7.7 billion on capital and exploration expenditures, including in the key Permian Basin area. Oil-equivalent production rose 3% compared to a year earlier, reaching 3.9 million barrels per day. Liquid production and natural gas volumes also increased by 4% and 1%, respectively.

The largest spike came from production in the Permian Basin, which grew 7% from the second quarter of 2019, and more than 70% year-over-year.

"We are making excellent progress on our long-term growth strategy," Exxon Chairman and CEO Darren Woods said. "Growth in the Permian continues to drive increased liquids production and we are ahead of schedule for first oil in Guyana. The value of our position in Guyana improved further this quarter with an additional discovery, our fourth this year. We are also making good progress on our advantaged investments in the Downstream and Chemical," he added.

Woods also said that Exxon made progress on divesting its assets, which the company forecasts will generate $15 billion in cash by 2025.

"The competitiveness of our portfolio was further enhanced with the divestment of non-strategic assets, reaching almost a third of our 2021 objective of $15 billion," he said.

Earnings were boosted by a favorable $300 million tax-related item.

For the year, Exxon stock is down 1% through Thursday's close, lagging both the S&P 500 and the energy sector. The S&P 500 is up 21% in 2019 while the energy sector is up 1%.

Last quarter, Exxon beat top and bottom line estimates, as strength in the company's upstream business offset weakness in the refining and chemical divisions. Profit did decline by 21%, however.

Falling oil prices, oversupply concerns and high production are among the factors that have hit the energy sector hard. It's also especially vulnerable to any signs of a global growth slowdown.