Lower oil and natural gas prices contributed to a 22 percent decline in Occidental Petroleum Corp.’s third-quarter profit, but the results were still better than Wall Street expected.

The Los Angeles company reported net income of $1.38 billion ($1.69 a share), compared with $1.77 billion ($2.17) in the same period a year earlier. Revenue fell 1 percent to $5.97 billion.

The Wall Street consensus was for earnings of $1.63 a share on revenue of $5.6 billion, according to FactSet.

Overall oil and gas production rose 3.7 percent to 766,000 barrels of oil equivalent a day. Domestic production rose 8 percent to a record 469,000 BOE a day, offsetting a small decline in international production. But the company was only able to sell oil for an average price of $96.62 per barrel, lower than the $97.24 it was able to charge a year earlier. In addition, the average price for domestic natural gas fell 41 percent to $2.48 per 1,000 cubic feet.

Shares closed up $1.84, or 2.3 percent, to $82.52 on the New York Stock Exchange.