(Reuters) - Kroger Co KR.N on Thursday raised the lower-end of its full-year earnings forecast and posted a better-than-expected quarterly profit, as investments in online and delivery services paid off, sending its shares up as much as 13 percent.

Under its “Restock Kroger” program, the supermarket chain has been cutting prices and experimenting with new ways of selling products, while also shutting underperforming stores and shifting away from areas where it does not have a strong presence.

The U.S. grocery industry, dominated by Walmart Inc WMT.N and Kroger, has been fearful that Amazon.com Inc AMZN.O would apply its current distribution strategy at Whole Foods, transforming existing stores into a grocery delivery network.

In response, Kroger has been expanding home delivery, curbside pickup and self-checkout services, apart from investing heavily in technology such as its recent deal with Ocado OCDO.L to speed up its delivery operations with the construction of robotically operated warehouses.

Some of these initiatives helped drive a 66 percent rise in online sales in the first quarter.

“The result suggests that Kroger’s investment in lower prices and its push on digital are both paying dividends,” GlobalData Retail Managing Director Neil Saunders said.

Kroger shares touched a near four-month high of $29.50 and clocked their best intraday day performance in 24 years.

The company raised the lower end of its adjusted profit forecast to a range of $2.00 to $2.15 per share from $1.95 to $2.15 per share, previously.

It also projected identical sales growth - excluding fuel but reflecting sales from specialty pharmacy and home delivery services - to rise in the range of 2 percent to 2.5 percent.

Gross margin slipped to 21.8 percent from 22.1 percent, but MoffettNathanson analyst Michael Montani commended the company for managing margins well in a very competitive grocery market.

Net earnings rose to $2.03 billion, or $2.37 per share, in the quarter from $303 million, or 32 cents per share, a year earlier, helped by the sale of nearly 800 of its convenience stores to EG Group for $2.15 billion.

Same-store sales, excluding fuel, rose 1.4 percent in the quarter.

“This print was better than feared with comparable-store sales probably slightly above buy side expectations and management’s tone about Restock Kroger quite positive,” J.P. Morgan analysts wrote in a note.

Excluding one-time items, Kroger earned 73 cents per share, 10 cents above analysts’ estimate.

Total sales rose 3.4 percent to $37.53 billion, while analysts’ were expecting revenue of $37.31 billion, according to Thomson Reuters I/B/E/S.