NEW YORK — Exxon Mobil Corp. said earnings rose slightly in the first quarter as profits from chemicals production surged enough to offset declining production of oil and natural gas. Lower taxes also helped.

The Irving, Texas, company reported Thursday that net income totaled $9.5 billion in the quarter, or $2.12 per share, on revenue of $108.8 billion. During last year’s quarter, Exxon earned $9.45 billion, or $2 per share, on revenue of $124.1 billion.

Analysts expected Exxon to earn $2.05 per share, on average.

Exxon’s chemicals and U.S. refining operations took advantage of the same low prices that dented revenue and profitability in its oil and gas production operations.