United Airlines reported its highest second-quarter revenue and enjoyed its first profitable quarter since the start of the Covid-19 pandemic, the carrier said Wednesday.

The Chicago-based airline, the second-largest in the United States, reported net income of $329 million on operating revenue of $12.1 billion. Revenue was up 6% from the March-June quarter in 2019, while flying with 15% less seat capacity.

Earnings per share came in at $1.43, below analyst estimates of $1.95 per share, according to Refinitiv.

Summer air travel was thrown into chaos in May and June as flight operations struggled to expand to meet a surge in pent-up demand created by the Covid-19 pandemic. More than 34,000 United flights to, from or within the United States have been canceled or delayed, equivalent to a quarter of its entire slate for those two months, according to FlightAware flight tracker .

“It’s good to get back to profitability, but we face three risks that could increase over the next six to 18 months,” chief executive Scott Kirby said, referring to “operational challenges at the scale industry challenges that limit system capacity, record fuel prices and the growing possibility of a global recession.

Ed Bastian, chief executive of rival Delta Air Lines, told the Financial Times last week that he was not worried about the potential impact of a recession on the airline industry.

United spent about $4.18 per gallon on fuel, consuming 912 million gallons in the second quarter. The airline expects fuel prices to moderate in the third quarter to $3.81 per gallon.

The carrier also expects third-quarter revenue to be up 11% from the same period in 2019, when it was $11.4 billion. United also reiterated their expectations for a profitable full year.