The bulk of Target Corp.’s sales continue to come from its brick-and-mortar locations. But the retailer’s concerted effort to use stores to dial in on digital shopping is changing its sales mix in measurable — and more profitable — ways.

Digital sales grew a hefty 42% during the spring quarter, which exceeded analysts’ expectations, the retailer said Wednesday.

Half of the gains in online and mobile sales came from shoppers who came to stores to pick up their own orders that day, or who used the retailer’s same-day home delivery service, Shipt.

Credit Suisse retail analyst Seth Sigman heralded Target’s focus on these “fast options.”

“Overall, while there are still plenty of debates on Target, we view it as a survivor, with potential for more share gains,” Sigman wrote in a note.

The growing popularity of the programs save Target on shipping expenses while still giving shoppers the convenience and speedy delivery they demand.

The services helped boost profit 11% during February, March and April, becoming the strongest sign yet that the Minneapolis-based retailer’s $7 billion-plus strategy to modernize stores and operations for the digital age is bearing fruit.

Target shares surged before the markets opened and ended the day up nearly 8%, at $77.56.

Target’s comparable sales for the quarter, both in stores and online, grew 4.8%, the eighth straight quarterly gain for the retailer. The company said it gained market share in all five of its major categories, but singled out toys and baby merchandise as particularly strong, as it continues to pick up sales from shuttered Toys ‘R’ Us and Babies ‘R’ Us stores.

The company said net earnings were $795 million on revenue of $17.4 billion for the period ended May 4, the first quarter of its fiscal year. Earnings per share were $1.53, at the high end of its guidance and well above the $1.43 expected by analysts surveyed by Refinitiv.

Target’s digital sales will become an increasingly key part of the retailer’s growth story. Last year, online and mobile sales totaled $5 billion, and stores fulfilled about two-thirds of that volume. The retailer is on track to add an additional $1 billion in the year ahead, officials said Wednesday, with an even higher portion handled at the store level.

Sales from in-store pickup, which has been available for about five years, increased more than 80% from a year ago. Drive-up service, which is available in about two-thirds of its stores, and sales through the $99 Shipt membership grew even faster.

“The fastest-growing services we provide are in same-day — that’s order pickup, drive up and Shipt,” Chief Operating Officer John Mulligan said. “Those are also our most profitable services we provide through the digital channel.”

Moody’s analyst Charlie O’Shea offered an upbeat response to the earnings report, given what he described as a “brutal pricing environment due to the ongoing Walmart/Amazon market share battle.”

“Even with the looming prospect of additional tariffs, we expect Target to continue as one of the top performers in U.S. retail,” O’Shea said.

While the previous round of the Trump administration’s tariffs focused on industrial equipment and machinery imported from China, the latest round includes a 25% import tax on range of consumer products, including electronics, fresh food, bike helmets, shoes and leather goods.

Target CEO Brian Cornell seemed to downplay the impact, while acknowledging that the tariffs will “lead to higher prices on everyday products for American families.”

“We have one big advantage, and that is our multicategory portfolio that allows us to flex our focus from category to category based on the environment,” Cornell said in a call with reporters. He hedged on how much the retailer would be able to absorb without raising prices, but said its sourcing team and vendor partners have spent years diversifying the manufacturing base beyond China.

“This didn’t just start yesterday,” Cornell said.

Target figured the effect of tariffs into its guidance, but expects current momentum to continue into the fiscal second quarter, which stretches through July. The company forecast comparable-sales growth in the low- to mid-single digits and earnings per share to be between $1.52 and $1.72 for the period.

Target maintained full-year guidance of comparable sales growth in the low- to mid-single digits. It expects per-share profit to range from $5.75 to $6.05, a percentage gain in the mid-single digits.