DALLAS (AP) — Southwest Airlines lost $278 million in the first quarter but said Thursday that it expects to be profitable for the rest of the year because of surging demand for travel.

The upbeat forecast echoed similar predictions this month from other big U.S. airlines. They say that after being mostly cooped up for two years during the pandemic, Americans are busting out their credit cards to book flights.

It is not all clear skies for the airlines, however. They face rising jet fuel prices and a tight supply of employees, particularly pilots. Southwest said its workforce grew by 3,300 people in the quarter, and CEO Robert Jordan said the airline was still “intensely focused” on hiring and training workers heading into the peak summer travel season.

Southwest predicted that second-quarter revenue will be 8% to 12% higher than the same quarter in 2019 even though it will operate 7% less passenger-carrying capacity. That is possible because of rising prices.

Southwest’s average fare in the first quarter was $159, up 32% from a year ago and 5% higher than during the same period in 2019. Fares are likely to rise further, partly because more travelers are booking far in advance, when prices tend to be higher, and because airlines limit the number of seats they sell at the cheapest fares.

“Any time you see strong demand, though, you’re going to see an increase in fares,” Jordan said on CNBC.

At the same time, Southwest hopes to soften the impact of rising fuel prices through its longtime practice of hedging, or buying options that pay off when fuel rises but can backfire if prices fall. The airline predicted that those hedges will earn 61 cents per gallon in the second quarter.

The nationwide increase in COVID-19 cases this winter spoiled the first quarter — Southwest was hit by high employee sick calls and canceled more than 6,300 flights in January alone, according to figures from tracking service FlightAware. But Jordan said the airline was back in the black by March.

“Based on current plans and expected continued strong bookings, we continue to expect to be solidly profitable for the remaining three quarters of this year, and for full-year 2022,” Jordan said in a prepared statement.

Savanthi Syth, an airline analyst for Raymond James & Associates, said Southwest’s forecast implies a second-quarter profit of $1.10 per share — well above Wall Street’s average prediction of 40 cents per share. She said Southwest’s outlook beat her most bullish expectations, which were already raised by upbeat comments from other airlines.

The nation’s four largest carriers — American, Delta, United and Southwest — lost more than $4.2 billion combined in the first quarter, but all expressed high hopes for a booming summer season and full airplanes. Delta reported record bookings, and the CEOs of American and United said they have never seen such strong demand for travel.

Southwest’s first-quarter loss compared with a profit of $116 million a year earlier, when Southwest was still receiving federal pandemic relief to help cover labor costs.

Excluding special costs, the Dallas carrier lost 32 cents per share. Revenue was $4.69 billion, more than double a year ago and 91% of revenue in the same quarter of 2019, before the pandemic.

The loss was slightly wider than analysts had expected. Analysts predicted a loss of 30 cents per share on revenue of $4.67 billion, according to a FactSet survey.

Shares of Southwest Airlines Co. rose nearly 3% shortly after the market opened Thursday.