(Reuters) - Macy’s Inc (M.N) reported a much better-than-expected increase in quarterly same-store sales, beating estimates for the second straight quarter, offering hopes for a company struggling to boost sales in the face of intense online competition.

FILE PHOTO: People gather at the Broadway entrance of Macy's Herald Square store ahead of early opening for the Black Friday sales in Manhattan, New York, U.S. November 23, 2017. REUTERS/Andrew Kelly/File Photo

Macy’s shares surged more than 13 percent in premarket trading after the company also raised its full-year profit forecast.

The company said it would end its joint venture with China-based Fung Retailing Ltd but would remain active on Alibaba’s e-commerce platform TMall.

The retailer’s 4.2 percent rise in same-store sales in the first quarter easily topped Wall Street’s 1.4 percent estimate.

The quarter benefited from a change in accounting that shifted its Friends & Family promotional program from the second quarter to the first, the company said.

“We exceeded our expectations and saw strong performance across all three brands — Macy’s, Bloomingdale’s, and Bluemercury — as well as across all geographic regions,” Chief Executive Officer Jeff Gennette said.

Net income attributable to Macy’s shareholders rose to $139 million, or 45 cents per share, in the first quarter ended May 5, from $78 million, or 26 cents per share, a year earlier.

Excluding one-time items, the company earned 48 cents per share topping analysts’ expectations by 11 cents.

Net sales rose 3.6 percent to $5.54 billion in the quarter, also beating expectations.

Reporting by Aishwarya Venugopal in Bengaluru; Editing by Saumyadeb Chakrabarty

Read more from our friends at Reuters: