By Melanie Evans and Dave Sebastian

HCA Healthcare Inc., one of the nation's largest hospital chains, said its profit rose on federal relief aid aimed at helping businesses navigate the coronavirus pandemic and due to the resumption of some hospital procedures.

The turnaround in the second quarter came as patients returned to operating rooms for medical procedures that had been postponed in the spring. But company executives said Wednesday they were prepared for renewed volatility as coronavirus cases surge again in some parts of the U.S.

HCA's profit in the first quarter had fallen from the same period last year, as traffic across most of the chain's medical services dropped.

"The second quarter was a remarkable 91 days for the company," Chief Executive Sam Hazen said on an investor call after the company released its earnings. "It started with a level of uncertainty and uneasiness that was very high as the pandemic began," he said.

Surgeries have steadily rebounded since a low-point in April, company executives said. HCA is responding to new surges in coronavirus cases in some states where it operates by alternating between scaling back and restarting procedures. "We do believe we're going to have to manage through Covid again," Mr. Hazen said. "But our ability to scale up, scale down, scale up, I think has now been proven."

HCA's earnings, among the first of hospital companies to be reported, offer an early look at how the pandemic is disrupting business across the $1 trillion hospital sector and how much benefit hospitals reap from federal relief, including payouts from a $175 billion aid fund. The government stimulus came through the Cares Act, which Congress passed in March to provide economic relief to help counter the impact of the pandemic.

Congress awarded the funds to offset revenue losses and higher expenses to hospitals that verified their need. HCA has so far been awarded $1.7 billion in relief, including $1.4 billion through June 30, but has yet to claim all of it, executives said on the call.

The Nashville, Tenn.-based hospital operator on Wednesday reported net income of $1.08 billion, or $3.16 a share, compared with $783 million, or $2.25 a share, in the comparable quarter last year. The company said it recognized $822 million, or $1.73 a share, in gains from the government stimulus funds.

The company declined to give guidance for the year, maintaining the view that it couldn't predict how the pandemic and economic contraction will continue to affect company performance. HCA was among many companies that withdrew guidance as the first quarter closed and disruption from the pandemic intensified into a sharp economic contraction.

"We're still very much early days in how this will play out," said Megan Neuburger, a managing director with Fitch Ratings and hospital credit analyst.

Revenue across the U.S. hospital sector plunged after a widespread halt to nonessential care under state orders for several weeks in March and April.

Hospitals have since intermittently stopped common, and often lucrative, surgeries. Analysts say the recession is also expected to slow health-care use as Americans lose health insurance and income with layoffs.

Hospitals across the South and West have delayed some surgeries again as coronavirus cases surge in those areas, but curbs have been more limited this time as hospitals push to maintain the services. Texas ordered hospitals in a widening number of counties to once again halt some surgeries. In Florida, hospitals have voluntarily suspended some surgeries.

HCA operates 91 hospitals in both states, nearly half of its total hospitals.

Executives on Wednesday said cases in its Texas hospitals might have peaked, but the surge is still underway in Florida. It has so far treated 33,000 Covid-19 patients, including more than 5,000 now in its hospitals, Mr. Hazen said.

The hospital chain said it avoided employee layoffs by reducing salaries of those idled by the shutdown. Many hospitals have furloughed and laid off workers, sharply curbed capital spending and slashed discretionary spending as operating rooms emptied out early in the year.

HCA's second-quarter sales fell 12.2% to $11.07 billion. Analysts polled by FactSet were looking for $10.1 billion.

The company said same-facility admissions fell 12.8% for the quarter, while same-facility equivalent admissions declined 20.1%. Emergency-room visits fell 32.9%, inpatient surgeries declined 15.7% and outpatient surgeries fell 32.6% -- all on a same-facility basis, which excludes facilities the company sold or closed in the prior year, the company said. Same-facility revenue per equivalent admission rose 10% for the quarter.

Write to Melanie Evans at Melanie.Evans@wsj.com and Dave Sebastian at dave.sebastian@wsj.com