Walgreen (WAG) reported stronger-than-expected first-quarter earnings on Friday as a renewed agreement with Express Scripts helped offset an influx of less expensive generic drugs and a series of one-time storm- and acquisition-related costs.

Sales fell 4.6% to $17.3 billion during the quarter ended Nov. 30 from a year-earlier $18.15 billion, driven by the switch to cheaper generic drugs from brand names, which impacted sales by $883 million.

Revenue, which slumped by 7.2% among prescriptions, narrowly missed the Street’s view of $17.43 billion. Shares of Walgreen traded nearly 2% lower to $36.83.

The U.S. pharmacy chain's earnings fell 25% to $413 million, or 43 cents a share, compared with $554 million, or 63 cents a share, in the year-earlier period. Excluding one-time items like Hurricane Sandy and acquisitions, Walgreen earned 71 cents, topping average analyst estimates in a Thomson Reuters poll by a penny.

The results benefited from an agreement reached with Express Scripts (ESRX) earlier this year and the faster-than-expected return of prescriptions to Walgreen.

“We saw the underlying performance of our business strengthen with improved gross profit margins and an upswing in comparable prescriptions filled in the quarter,” Walgreen CEO Greg Wasson said in a statement. “In many respects, this quarter was a turning point with the increasing pace of return of Express Scripts customers to our pharmacies.”

The Deerfield, Ill.-based company said it is also pleased with the performance of its new strategic partner, Alliance Boots, and remains on track to meet its first-year synergy targets with the U.K. retail giant.

Follow Jennifer Booton on Twitter at @Jbooton