(Reuters) - Canada's largest grocer Loblaw Cos Ltd's (>> Loblaw Companies Limited) quarterly profit handily beat analysts' expectations, helped by strong pharmacy sales in its recently acquired Shoppers Drug Mart.

Sales at Shoppers [SDMC.UL] accounted for more than a quarter of Loblaw's total sales of C$10.31 billion ($9.61 billion) in the second quarter. This was the first time that Shoppers contributed to Loblaw's sales.

Loblaw, majority-owned by George Weston Ltd (>> George Weston Limited), bought Shoppers last year to better compete against U.S rivals such as Wal-Mart Stores Inc (>> Wal-Mart Stores, Inc.) and Target Corp (>> Target Corporation).

Second-quarter same-store sales, excluding Shoppers, rose 1.8 percent, compared with a 1.1 percent rise a year earlier.

Loblaw last week appointed Executive Chairman Galen Weston as president and said Domenic Pilla, the president of Shoppers, would leave by the end of the year as part of a series of management changes.

Excluding one-time items, Loblaw earned 75 Canadian cents per basic share, higher than the analyst average estimate of 67 Canadian cents per share, according to Thomson Reuters I/B/E/S.

Revenue rose 37 percent to C$10.31 billion.

Loblaw posted a net loss of C$456 million, or C$1.13 per share, for the second quarter ended June 14, mainly due to costs related to the acquisition. It had reported a profit of C$177 million, or 62 Canadian cents per share, a year earlier.

Loblaw's stock has risen about 7 percent in the last year to its Wednesday's close of C$51.34 on the Toronto Stock Exchange.

($1 = 1.0723 Canadian Dollars)

(Reporting by Sneha Banerjee in Bangalore; Editing by Kirti Pandey and Sriraj Kalluvila)