Exxon Mobil reported on Friday that its first-quarter profits fell nearly 50% from a year ago, hit by poor results in its refining and chemicals segments.

Shares of the oil giant were down more than 2% on Friday.

Exxon reported a quarterly loss in its downstream business, which focuses on refining oil into fuels like gasoline and diesel. The company said brimming stockpiles of gasoline led to weak fuel margins during the quarter. It also continued a heavy slate of refinery maintenance.

That maintenance has weighed on downstream profits in recent quarters, and Exxon warned analysts on Friday that it will continue in the second quarter of 2019.

Profits in the chemicals business also tumbled $219 million from a year ago. While Exxon sold more chemicals, profit margins came under pressure because the industry has recently added capacity.

The oil major's output of crude, natural gas and other fossil fuels reached 4 million barrels of oil equivalent, up 2% from last year. Still, income in the upstream exploration and production unit fell by $621 million from last year.

While crude oil prices strengthened, they still remained relatively weak, Exxon said.

"Solid operating performance in the first quarter helped mitigate the impact of challenging Downstream and Chemical margin environments," Exxon Chairman and CEO Darren Woods said in a statement.

Exxon earned $2.35 billion in the first quarter, compared with $4.65 billion a year ago. Earnings per share came in at 55 cents, compared with 70 cents forecast by a Refinitiv survey.

Revenues were $63.63 billion, down 6.7% from a year ago and short of analysts' estimates for $64.82 billion.

Exxon also saw capital and exploration expenses increase from $4.87 billion a year ago to $6.89 billion this quarter.

The results showed Exxon continuing to increase its oil and natural gas production after the energy giant broke a streak of declining output last quarter. The company's production figures were in line with Wall Street expectations, according to StreetAccount.

Last month, Exxon announced plans to hike oil and gas production from the Permian Basin by 80 percent, with a goal of pumping 1 million barrels of oil equivalent per day as soon as 2024. The Permian is the top U.S. shale oil region, stretching across western Texas and southeastern New Mexico.

On Wednesday, Exxon raised its quarterly dividend by 5 cents to 87 cents per share.

Also Friday, Chevron reported first-quarter earnings that beat expectations, even as profits fell from a year earlier.