Kroger shares soared Thursday on strong earnings, which were boosted by the company's online investments and delivery services.

The stock closed with shares up 9.74 percent, having had its best day since Mar. 10, 2009.

The largest U.S. supermarket chain said adjusted earnings were $626 million, up from adjusted earnings of $546 million in last year's first fiscal quarter ending in May. Adjusted earnings per share of 73 cents beat the consensus of analysts by 10 cents.

Revenue of $37.5 billion was up 3.4 percent from last year.

The company said first-quarter results were driven by improvements in online retail, with online sales increasing 66 percent. Online sales and delivery services have become imperative as the company competes with other services offering grocery deliveries, such as Walmart and Amazon.

In the past year, Kroger has closed underperforming stores and focused on areas where the grocer has a strong presence, selling nearly 800 of its convenience stores to EG Group for $2.15 billion. The grocer also expanded its home delivery, curbside pickup and self-checkout services under their "Restock Kroger" initiative.

"Restock Kroger is off to a fantastic start...," Chief Executive Officer Rodney McMullen said in a statement. "We are confident in our ability to deliver on our plans for the year and our long-term vision to serve America through food inspiration and uplift."

Also boosting the stock Thursday was Kroger's more optimistic view for the near term. It raised the lower end of its 2018 adjusted profit forecast range to $2 per share from $1.95. The company now expects earnings per share to range between $2 and $2.15.

Still, the grocery store operator's stock has had a wild ride over the past year. After its last earnings release on Mar. 8, 2018, the stock plunged 11 percent. Since then, the grocer's shares have climbed 12 percent. Kroger shares are up 28 percent in the past year.