(Reuters) - Chevron Corp CVX.N swung to a quarterly profit on Friday, helped largely by resurgence in oil and gas production as prices jumped and costs slipped.

Projects that Chevron had been building for years have started to come online and allowed Chevron to progress from spending on construction to marketing and sales. With oil prices inching higher, that also boosted the company’s profit.

“We’re delivering higher production with lower capital and operating expenditures,” Chief Executive John Watson said in a statement.

The company reported a second-quarter net income of $1.45 billion, or 77 cents per share, compared to a net loss of $1.47 billion, or 78 cents per share, in the year-ago quarter.

Excluding one-time items, the company earned 91 cents per share. By that measure, analysts expected earnings of 87 cents per share, according to Thomson Reuters I/B/E/S.

Production surged 10 percent to 2.89 million barrels of oil equivalent per day.

Shares of San Ramon, California-based Chevron were down slightly in premarket trading, shedding 0.1 percent to $106.

Rival Exxon Mobil Corp XOM.N reported a lower-than-expected quarterly profit earlier on Friday.