HOUSTON — The two mightiest American companies don’t look so mighty any more.

With oil and prices at record lows and refining profit margins weakening, on Friday posted its smallest profit for any quarter since 1999, while reported a large first-quarter loss of $725 million, compared with a gain of $2.6 billion in the period a year earlier.

Weak results were expected given that oil prices plunged to below $30 a barrel during the first quarter — a 13-year-low — while natural gas prices fell to their lowest level in nearly 17 years. Investors were mixed on the results, with Exxon Mobil shares rising modestly and Chevron’s falling in early trading.

The oil and gas industry has gone through its most severe crisis since the price collapse in the 1980s. There have been at least 62 oil and gas company bankruptcies over the last year or so, and roughly 120,000 American oil and gas workers — nearly one out of four nationwide — have lost their jobs.

Worldwide, oil companies have debts surpassing half a trillion dollars, which energy experts say will force many to sell assets to meet interest payments.

Neither Exxon Mobil nor Chevron is going out of business soon, and their large refinery businesses, which benefit from low oil and gas prices, have helped both survive the downturn better than most of their competitors.

Nevertheless, Standard & Poor’s this week to AA+, citing the near tripling of the company’s debt to almost $20 billion last year from 2013 as it struggled to replace reserves. The move came after wholesale ratings cuts to virtually the entire oil and gas industry. Showing its confidence in its future, however, Exxon Mobil raised its dividend slightly the next day.

Wall Street analysts said that for the first quarter were actually better than expected. Exxon, which is based in Texas and is the biggest American oil company, reported a quarterly profit of $1.8 billion, down from $4.9 billion in the first quarter of 2015. Revenue in the 2016 quarter dropped 28 percent, although strong results from its chemical production helped keep the company in the black. The company said it cut its capital spending by a third to protect its balance sheet.

Interactive Feature | Oil Prices: What’s Behind the Drop? Simple Economics The oil industry, with its history of booms and busts, is in a new downturn.

“It was a good quarter for Exxon Mobil,” said Brian Youngberg, senior energy analyst at Edward Jones. While noting that “U.S. production lost money as expected due to higher-cost oil shale and low natural gas prices,” he added, “the company has reduced capital spending to more closely live within its cash flow.”

As for Chevron, Mr. Youngberg said it was a disappointing quarter. “Cost-cutting efforts will need to be ramped up even more,” he said.

were somewhat larger than expected. Its revenue fell more than 30 percent, to nearly $23.6 billion, in large part because of losses in its exploration and production operations in the United States. The company announced it would cut 1,000 more jobs this year, bringing total cuts to 8,000 employees.

Earnings for Exxon Mobil, Chevron and other oil companies are expected to improve in the second quarter because oil prices have rebounded sharply from the price collapse to under $30 a barrel during the early months of the year.

The American benchmark price rose above $45 a barrel this week for the first time since November. Nevertheless, few wells can be economically drilled when prices are below $50 a barrel, according to oil company executives.

Global oil and natural gas inventories remain at near-record levels, with Russian output rising in recent months and Iran increasing its production by several hundred thousand barrels a day after the easing of nuclear sanctions. In the United States, crude supplies rose two million barrels to 540.6 million last week, the most since 1929, according to the Energy Department.

But experts view the glut as temporary because of expected declines in production by several major producers, including Kazakhstan, China, Mexico and Colombia, and growing instability in Venezuela.

Global oil supplies dropped by nearly 300,000 barrels a day in March to 96.1 million barrels a day, according to the International Energy Agency in Paris.

Interactive Feature | Related Coverage

The biggest driver in the glut has been the United States, with the rise in shale oil. But now American production is dropping fast, by more than 600,000 barrels a day over the last year, to 8.9 million barrels a day.

Experts project that production will drop by an additional 600,000 barrels a day in the coming months. With 77 percent of the rigs in the United States decommissioned over the last two years, there is a natural decline in domestic production of oil and natural gas. Over all, the international rig count has fallen roughly 32 percent, according to a recent report by Citi Research, a division of Citigroup Global Markets.

Exxon Mobil and Chevron executives put the best face on their results and expressed optimism about the future.

“Our capital spending is coming down,” said John Watson, Chevron’s chief executive. “We continue to lower our cost structure with better pricing, work flow efficiencies and matching our organizational size to expected future activity levels.”

Jeff Woodbury, Exxon Mobil’s vice president for investor relations, said in a conference call, “These results demonstrate the durability of our integrated business enhanced by our relentless focus on managing those factors we can control, including effective cost management.”

Worldwide, oil executives estimate that industry investment will total roughly $400 billion this year, a decline of nearly half from the $700 billion invested in 2014, when oil prices climbed to over $100 a barrel before tumbling at the end of the year.

“By the end of the year, we could see a rebalancing of the market,” Patrick Pouyanne, chief executive of the French oil company Total, told a Columbia University energy conference this week. Noting the sharp cuts in investments for exploration by oil companies around the world, he suggested that a sharp price rebound was probably just a matter of time. “The consequence in three or four years will be a lack of supply,” he added.

Earnings for major oil and gas companies in the first quarter were poor across the board. ConocoPhillips reported a loss of $1.47 billion, contrasted with a gain of $272 million during the first quarter the year before. Hess reported a first-quarter loss of $509 million, compared with a loss of $389 million the year before.