What happened

Shares of Walgreens Boots Alliance (WBA -0.61%) jumped on Thursday following a fiscal third-quarter report that beat expectations. While Walgreens recorded a steep decline in earnings, it wasn't enough to derail the stock. Shares of the company were up about 4.3% at 3:40 p.m. EDT.

So what

Walgreens reported third-quarter revenue of $34.6 billion, up 0.8% year over year and $70 million above the average analyst estimate. Sales in the U.S. retail-pharmacy segment rose 2.3%, to $26.5 billion, while international retail pharmacy sales slumped 7.3%, to $2.8 billion, and pharmaceutical wholesale revenue dropped 1.7%, to $5.9 billion.

A rising stock chart in yellow on a blue background.

Image source: Getty Images.

Non-GAAP (adjusted) earnings per share came in at $1.47, down from $1.53 in the prior-year period but $0.04 higher than analysts were expecting. Adjusted operating income was down 11.7% year over year, while GAAP operating income plunged 24.7%. Share buybacks helped boost the per-share numbers by reducing the outstanding share count.

A decline in gross margin hurt the company's bottom line during the third quarter. Walgreens' gross margin was 21.5% in the quarter, down from 22.7% in the prior-year period. Gross profit declined in the U.S. retail pharmacy business due to reimbursement pressure and lower retail sales.

"We will continue our aggressive response to rapidly shifting trends, and have already seen improved U.S. retail sales and prescription growth and are making good progress in implementing our Transformational Cost Management Program," said Walgreens CEO Stefano Pessina.

Now what

Despite the earnings decline in the third quarter, Walgreens maintained its full-year guidance for adjusted earnings per share (EPS). The company expects adjusted EPS to be roughly flat on a constant-currency basis. On a reported basis, currency will reduce adjusted EPS by approximately $0.06.

While Walgreens' third quarter wasn't a particularly strong one, the results were better than expected. That was enough for investors to push up the stock.