(Reuters) - U.S. drugstore chain operator Walgreen Co (>> Walgreen Company) reported a better-than-expected quarterly profit, helped by a record number of prescriptions filled, sending its shares up 3.6 percent.

Cost savings resulting from its acquisition of the remaining stake in Alliance Boots Holdings Ltd [ABN.UL], Europe's biggest pharmacy chain, also boosted first-quarter results.

The largest U.S. drug retailer also said it was on track to reach its target of $650 million in savings from the Alliance Boots deal in the fiscal year ending August 2015.

The company's margins, however, continue to remain under pressure due to lower insurer payments for prescriptions amid increased competition and a rise in generic drug prices.

Gross margins decreased 1 percentage point to 27.1 percent in the first quarter ended Nov. 30, marking the fifth straight quarter of decline.

The combined cost savings for Walgreen and Alliance Boots in the quarter were about $140 million.

The company said in August it would acquire the 55 percent it did not already own in Alliance Boots in a deal valued at $15 billion.

The company said it filled a record 222 million prescriptions in the quarter ended Nov. 30, up 4.3 percent from a year ago.

Smaller rival Rite Aid Corp (>> Rite Aid Corporation) also reported higher quarterly sales and profit and lifted its full-year earnings forecast last week, helped by strong prescription sales.

Net income attributable to Walgreen rose 16 percent to $809 million, or 85 cents per share. Excluding items, earnings were 81 cents per share in the first quarter.

Net sales rose 6.7 percent to $19.55 billion, with same-store sales rising 5.7 percent.

Analysts on average had expected a profit of 75 cents per share on sales of $19.5 billion, according to Thomson Reuters I/B/E/S.

Walgreen's shares were trading at $76.90 before the bell on Tuesday.

(Reporting by Sruthi Ramakrishnan in Bengaluru and Nandita Bose in Chicago; Editing by Ted Kerr and Saumyadeb Chakrabarty)

Stocks treated in this article : Rite Aid Corporation, Walgreen Company