Big oil companies are raking in their highest profits since the onset of the coronavirus pandemic, but they plan to continue spending sparingly to boost production despite higher commodity prices.

Exxon Mobil Corp. reported $4.7 billion in second quarter profit Friday, while rival Chevron Corp. reported $3.1 billion in quarterly profit.

The results represented a dramatic turnaround from a year earlier, when Exxon reported a quarterly loss of $1.1 billion and Chevron lost $8.3 billion as demand for oil and gas plummeted due to the closing of economies worldwide due to the virus.

Some of the largest European oil companies also reported strong results earlier in the week. Royal Dutch Shell PLC reported $5.5 billion in net income, while TotalEnergies SE posted $3.5 billion in profits.

The oil-and-gas industry has recovered from unprecedented losses in 2020 as economies have reopened this year, sending prices surging to their highest levels in two years. U.S. oil prices have mostly stayed above $60 per barrel since March, after briefly turning negative last April and remaining below $50 for most of 2020. Oil prices closed at nearly $74 per barrel on Thursday.

Still, none of the major western producers said they would increase capital spending, as the companies face pressure from investors to moderate their growth and clean up their emissions amid concerns about growing regulations and climate change. Some European companies have promised to let production decline as they invest more in renewable energy.

Exxon cut its annual capital budget last year from $25 billion to $19 billion or less. It said Friday its capital expenditures this year will be closer to $16 billion and that its oil and gas production was down 2% from the same period last year.

“We think we have a good plan on our investments, we’re making good progress on debt,” Exxon Chief Executive Darren Woods said on a call with analysts Friday. “We are focused on bringing in more profitable, higher value barrels.”

Chevron said Friday it, too, wouldn’t raise capital spending. It spent $5.3 billion on capital expenditures in the first six months of 2021, compared with $7.7 billion in the first six months of last year. Chevron previously said it would increase annual production at about 3% or less through 2025 and give priority to returning money to shareholders.

Share Your Thoughts

What is your outlook for the oil industry? Join the conversation below.

Both companies benefited from strong profits in their chemical businesses as demand for plastics and other products have surged this year. Exxon said its chemical unit had its best quarter on record, reporting $2.3 billion in profits.

The restrained spending is an overture to investors who fled the sector after a decade of poor returns and longer-term concerns about the future for fossil fuels.

“Wall Street is not looking for accelerated reinvestment into the oil and gas business,” said Dan Pickering, chief investment officer at Pickering Energy Partners. “This is a combo of ESG and energy transition concerns and scar tissue from the past decade.”

Shares in many oil gas companies have sharply rebounded this year but remain below their pre-Covid-19 prices. Chevron’s stock is up more than 21% this year, but down about 3% from February of last year, while Exxon is up nearly 43%, but is also down about 3% from pre-pandemic prices. An index of large oil-and-gas company stocks is up about 43% this year, but down around 39% from five years ago.

Chevron Chief Financial Officer Pierre Breber said many investors still question oil producers’ commitment to capital discipline, especially with rising commodity prices.

“Demand for our products has fully recovered, except for jet [fuel],” Mr. Breber said in an interview. “Demand for our stock is more slowly recovering.”

Exxon may have difficulty increasing investor payouts through share buybacks due to its nearly $60 billion in debt.

Exxon may have difficulty increasing investor payouts through share buybacks due to its nearly $60 billion in debt.

Photo: David Paul Morris/Bloomberg News

To lure them back, Chevron has given priority to shareholder payouts this year. On Friday, it said it would resume share buybacks, which it paused in March 2020, at a rate of $2 billion to $3 billion a year. Chevron increased its dividend by 4% in April. Shell and Total reinstated buybacks this week as well.

Chevron on Thursday also announced a new business unit dedicated to technologies to lower carbon emissions. The move followed a similar announcement in February by Exxon, which said it would invest $3 billion through 2025 in a new, low-carbon business division.

Increasing investor payouts could be more difficult for Exxon, whose balance sheet holds more debt than Chevron’s. The Irving, Texas-based company has nearly $60 billion in debt, according to S&P Global Market Intelligence, compared with Chevron’s roughly $38 billion in debt. Exxon held its dividend flat earlier this year.

Exxon will need to increase capital spending in its core assets, particularly in Guyana and the Permian Basin in West Texas and New Mexico, to generate the cash it needs to pay down debt and reward investors, said Biraj Borkhataria, an analyst at RBC Capital Markets.

Exxon, the largest Western oil company, lost three seats on its board of directors at its annual shareholder meeting in May to hedge fund Engine No. 1, which had argued Exxon spent recklessly for years on unprofitable projects and had no strategy to navigate the energy transition.

“Capex increases on the core business are a challenging narrative,” Mr. Borkhataria said. “But Exxon’s $15 billion dividend is not going to be funded by low carbon assets any time soon, so the capital will need to be allocated to the core business for the foreseeable future.”

So far, Exxon has held to its spending cuts. In the Permian, Exxon has reduced the number of rigs it is operating there since March of last year by around 85% to less than 10, according to Andrew McConn, an analyst at Enverus, an energy data analytics firm. Chevron has made similar reductions, he said, and neither company has added rigs in recent months even as smaller producers have.

Kevin Holt, senior portfolio manager for Invesco Ltd., said big oil companies must use their cash to pay down debt and ensure their dividends are sustainable.

According to Mr. Holt, there is still enough uncertainty about oil supply and demand to keep commodity prices and producer spending in check for now. Oil prices briefly dipped earlier in July over fears new variants of the Coronavirus will crimp the economic recovery and that OPEC and its allies could increase their production more aggressively. The question, said Mr. Holt, is will the austerity hold.

“Companies are disciplined in 2021, but will they do it in 2022?” said Mr. Holt. “What we need out of these companies is conservatism in production and consistency.”

Write to Christopher M. Matthews at christopher.matthews@wsj.com