(Reuters) -UnitedHealth Group Inc raised its full-year profit forecast on Friday and beat Wall Street estimates for third-quarter earnings, as lower spending on COVID testing and treatments helped keep medical costs low.

While Omicron-related infections led to spikes in hospitalizations earlier this year, insurers and hospitals have said the length of stay for patients has been shorter than in the earlier waves.

It has helped rein in costs for health insurers, who have seen massive fluctuations in their medical spending during the pandemic. Analysts had also said before the earnings that a recovery in non-urgent surgeries has been slow across some categories, which could help control costs.

UnitedHealth, the largest U.S. health insurer, expects adjusted full-year profit between $21.85 and $22.05 per share compared with $21.40 to $21.90 forecast earlier.

Its medical care ratio – the percentage of premiums versus payouts on claims – improved to 81% in the third quarter ended Sept. 30 from 83% last year. Analysts had expected a ratio of 82.4%.

Quarterly profit rose to $5.26 billion, or $5.55 per share, from $4.09 billion, or $4.28 per share, a year ago.

Excluding items, UnitedHealth earned $5.79 per share, beating estimates of $5.42, according to IBES data from Refinitiv.

(Reporting by Khushi Mandowara and Manas Mishra in Bengaluru; Editing by Shinjini Ganguli)