Airbnb reported a $55 million profit for the fourth quarter, reversing a huge loss a year earlier, as its revenue soared above pre-pandemic levels.

The San Francisco-based short-term-stay company said bookings surged in small and towns and rural areas, and improved even in urban areas, which were hit hardest earlier in the pandemic.

Airbnb hosts were also able to raise prices. The average daily rate in late 2021 was $154, a 20% jump from a year earlier and 36% higher than the same quarter in 2019. The company cited strong demand for rentals in North America and an ongoing shift toward customers booking entire homes and vacation destinations where prices are usually higher.

The company predicted that bookings and prices will rise again in the first quarter because of strong demand for travel. Together, the company said, those trends will boost first-quarter revenue to between $1.41 billion and $1.48 billion, well above the $1.23 billion forecast in a FactSet survey of analysts.

Airbnb shares rose 6% to close at $180.07 in regular trading, then gained almost 4% after the closing bell.

Airbnb said the omicron variant of COVID-19 had less effect on bookings and cancellations than last year’s delta variant. Virus cases are still at high levels in the United States, but the San Francisco-based company said summer bookings made by the end of January were running 25% ahead of the same time in 2019, before the pandemic.

CEO Brian Chesky told analysts on a call that he is confident cross-border travel and bookings in cities will pick up. He repeated a longstanding theme of his: that the pandemic has freed some people to work remotely, leading to an increase in long-term bookings on the site.

Airlines and many other travel-related companies were hurt by the surge in COVID-19 cases that began in December, with the rise of omicron. In January, U.S. air travel remained more than 20% below 2019.

Travel industry executives say, however, that they expect business to bounce back once omicron fades.

Expedia Chairman and CEO Peter Kern said last week that omicron was less severe and shorter than previous waves of the coronavirus, and he predicted “a solid overall recovery in 2022, barring a change in the trajectory of the virus.” Expedia sells hotel rooms and owns Airbnb rival Vrbo.

The closure of offices has helped Airbnb, as some white-collar workers have opted to work from rental housing far from home. A rising percentage of Airbnb bookings have been long — 28 days or more.

Similarweb, which tracks internet traffic, said last week that Airbnb’s site gets more traffic and conversions — visitors who make a purchase — than competitors including Vrbo. The firm shrugged off a drop in site traffic in late 2021 as seasonal, and said customers’ tendency to stay longer and view more pages “could signify growing brand loyalty” for Airbnb.

The fourth quarter marked Airbnb’s second straight profitable quarter, and compared with a loss of $3.9 billion in late 2020.

Earnings equaled 8 cents per share. Revenue rose 78% over a year ago — and 38% over the same quarter in 2019 — to $1.53 billion.

Analysts expected the company to earn 4 cents per share on revenue of $1.46 billion, according to a FactSet survey.

For all of 2021, Airbnb still lost $352 million, compared with a loss of $4.58 billion in 2020.