Rite Aid topped Wall Street expectations for the fiscal second quarter and gave a revised annual forecast, one quarter after withdrawing it due to COVID-19 uncertainty.

The drugstore chain said Thursday that its quarterly loss shrank to $13.2 million from $79.3 million in the previous year’s quarter. An income tax drop, an inventory credit and pharmacy sales growth helped.

Earnings, adjusted for one-time gains and costs, totaled 25 cents per share. Revenue grew more than 11% to $5.98 billion.

Analysts expected, on average, a penny per share in earnings on $5.75 billion in sales, according to FactSet.

Camp Hill, Pennsylvania-based Rite Aid Corp. runs more than 2,400 pharmacies in 18 states and also provides pharmacy benefits through its Elixir business.

Bigger competitors like Walgreens and CVS Health have seen their drugstore prescription sales fall, as the global pandemic kept customers home and away from the doctor’s office, especially earlier this year.

Rite Aid did see a decline in some prescriptions in its fiscal first quarter. But prescriptions filled in established stores climbed more than 2% in the quarter that ended in August.

Overall sales from established stores climbed more than 3%.

The company also booked an $8.7 million “last-in-first-out,” or LIFO, inventory credit in its second quarter. That compares to a $7.5 million charge last year.

The company’s income tax expense also fell from more than $27 million to $47,000.

Rite Aid now expects full-year fiscal 2021 results to range from a loss of 67 cents per share to earnings of 9 cents per share.

Analysts expect earnings of 38 cents per share, on average.

Shares of Rite Aid slipped 7 cents to $13.29 before markets opened Thursday.

That stock price has dropped 14% since the beginning of the year, but it has increased 70% in the last 12 months.

Elements of this story were generated by Automated Insights (http://automatedinsights.com/ap) using data from Zacks Investment Research. Access a Zacks stock report on RAD at https://www.zacks.com/ap/RAD