United Parcel Service Inc. posted profit that beat analysts’ estimates as price increases and efficiency gains helped offset higher costs and a decline in package deliveries.

Adjusted earnings were $3.05 a share in the first quarter, the Atlanta-based courier said in a statement Tuesday. Analysts had predicted $2.88. Revenue rose 6.4% to $24.4 billion.

The results are an indication of UPS’s resilience as the e-commerce boom during the Covid-19 pandemic starts to recede, while Russia’s war in Ukraine threatens to dampen global growth and costs rise on everything from labor to tires to fuel.

The company raised prices and focused more on higher-paying small businesses during the period of higher demand for post, and Chief Executive Officer Carol Tome shored up margins by routing parcels more efficiently and shedding a low-profit freight unit.

“The agility of our network and the continued execution of our strategy delivered another quarter of strong financial performance,” Tome said.

The shares rose 3.4% to $196 in pre-market trading trading. UPS has declined 12% this year while the S&P 500 Index dropped 9.9%

Average package volume dropped 3.6% from a year earlier, though the company made up for that with a 9.4% gain in revenue per parcel. The pricing power helped UPS increase adjusted operating margin to 13.6% from 12.9% a year earlier.

UPS plans to double share repurchases this year to $2 billion, and reiterated a 2022 revenue goal of $102 billion. Adjusted operating margins are still seen at about 13.7%.