CHICAGO (AP) — United Airlines reported Wednesday that it lost $1.38 billion in the first quarter of 2022 but said it expects to return to profitability in the current three-month period as post-pandemic travel ramps back up.

The Chicago-based airline posted revenue of $7.67 billion in the quarter that ended March 31. That was down 21% from the first quarter of 2019.

The airline is still running fewer flights than before the pandemic. But it said it had reopened all of its lounges, resumed 19 international routes and restarted services to six cities that haven’t been served since the pandemic began.

Shares in United Airlines Holdings Inc. jumped almost 8% in after-hours trading following the earnings report.

The number of miles flown by paying passengers fell 27% from a year earlier. However United is flying with roughly 73% of its available seats full. While not as high as the 81% of all seats before the pandemic, it is much better than it was in 2021 first quarter, when roughly half of all seats were filled with paying passengers.

The first quarter started off troubled for the airline industry, dominated in the early weeks by omicron variant of the COVID-19 virus. The virus abated, and caseloads across the U.S. have been low for some time. A federal judge this week put an injunction on the government’s mask mandate on planes, trains and travel hubs but the Justice Department said Wednesday it is filing an appeal seeking to overturn the order .

“We continue to believe we will see a strong spring and lead in to summer as restrictions disappear and more people travel,” said analysts at Cowen & Co. “We believe if the U.S. testing mandate were to be eliminated, we would see strong pent-up demand for the summer on transatlantic routes.”

The airline appeared optimistic that its pandemic-related losses were behind it. United said it expects to post a profit for the second quarter and for the full year 2022. This is despite United facing higher fuel costs this quarter, paying on average $2.88 for fuel, up 40% from a year earlier. The airline forecasted an operating gross margin of 10%, which was above analysts’ expectations.

“The demand environment is the strongest it’s been in my 30 years in the industry … we’re now seeing clear evidence that the second quarter will be an historic inflection point for our business,” United Airlines CEO Scott Kirby said in a statement.

United’s quarterly loss amounted to $4.24 a share and compared to a loss of $1.36 billion, or $4.29 a share, in the same period a year earlier. Analysts had been expecting a loss of $4.22 a share in the latest quarter, according to FactSet.