Exxon Mobil Corp on Friday reported a 49 percent fall in first-quarter profit that missed forecasts due to lower oil and gas prices and weakness across its major businesses that outweighed modest production gains.

The largest U.S. oil producer saw its first loss in its refining business since 2009 due to higher maintenance costs and what it called the worst refining margins in a decade.

Exxon also saw lower profits in chemicals and oil and gas production.

“It was a tough market environment for us this quarter,” Exxon Senior Vice President Jack Williams said on a call with analysts.

First-quarter profit fell to $2.35 billion, or 55 cents a share, from $4.65 billion, or $1.09 a share, a year ago.

Cash flow from operations of $8.3 billion was offset by capital spending and dividend payments of $10.4 billion.

“They had a large $2 billion cash flow shortfall that I don’t think investors will be comfortable with,” said Jennifer Rowland, analyst with Edward Jones.

She added that the share repurchases carried out by other oil majors seemed unlikely for Exxon. She expects the company to invest heavily and outspend cash flow for the next few years.

Shares were down about 2.8 percent in morning trading on Friday.

Irving, Texas-based Exxon also took a $115 million impairment charge in its U.S. oil and gas operations.

Analysts had expected Exxon to earn 70 cents per share, according to Refinitiv Eikon estimates.

Maintenance and production curtailments in its Canadian oil production, as well as weak oil and natural gas prices, pushed profits down in its oil and gas unit by 10.3 percent, the company said.

“Clearly this is a weak set of results,” RBC Capital Markets said in a client note, adding that, given the company’s solid fourth-quarter performance, it had seemed Exxon was turning a corner. “Clearly, the corner is further away than we expected and we expect this to lead to underperformance in the near term.”

Exxon’s oil and gas production rose 2 percent overall to 4 million barrels per day (bpd), up from 3.9 million bpd in the same period the year prior.

The company’s growing output in the Permian Basin, the largest U.S. shale basin, was a bright spot, rising to 226,000 barrels of oil equivalent per day in the first quarter, up 19 percent from the previous quarter and doubling the production level from the year prior.

Exxon is running 46 drilling rigs in the basin and plans to increase to 55 rigs by the end of the year.

A takeover battle between rival oil major Chevron Corp and Occidental Petroleum Corp for Anadarko Petroleum Corp has prompted speculation about other Permian Basin mergers and acquisitions.

“I would be surprised if over time we did not pick up some more Permian acreage,” Williams said when an analyst asked about possible acquisitions, but added that Exxon “doesn’t need to.”

The refining business lost $256 million in the first quarter, compared with a profit of $940 million in the same period last year. Exxon said refining margins were “improving” this quarter on higher gasoline demand.

Its chemicals business earned $518 million, down 53 percent from profits of $1.1 billion during the same period last year, while its upstream business, which pumps oil and gas, had a profit of $2.9 billion, down 18 percent.