Heavy investments in stores and its online operations are paying off at Target, which reported strong numbers across the board in the second quarter.

Sales at stores opened at least a year, a key measure for a retailer’s health, rose 6.5 percent, the strongest growth in 13 years. Traffic in stores and online rose 6.4 percent, the strongest showing since 2008 when it first started releasing that information.

Online sales soared 41 percent, surging past the 28 percent jump in the previous quarter.

It also raised its annual earnings expectations Wednesday.

Target is pouring money into its operations with Americans demanding convenience and speed in the age of Amazon. And with consumer confidence rising in a strong job market, they spending more freely. Nordstrom, Walmart and Home Depot and others have raised their outlooks for the year. Walmart is reporting its strongest same-store sales growth in more than a decade.

Target is re-investing more than $7 billion through 2020 to update stores and it’s seeking to penetrate urban areas with smaller locations. It created its own brands like Pillowfort and Cat & Jacks, and shoppers are buying them. It also is trying to improve the experience in its stores by retraining employees and paying them better.

With last year’s acquisition of same-day delivery service Shipt for $550 million, Target is now offering same-day delivery of groceries and other merchandise to more than 1,100 stores in 160 markets. It also began curbside pickup service for online shoppers at more than 800 stores in 25 states and next-day delivery for some items nationwide.

“Target hit the bulls-eye in (the second quarter), with improvement across virtually every meaningful measure, ” said Moody’s lead retail analyst Charlie O’Shea.

The Minneapolis retailer reported a profit of $799 million, or $1.49 per share. Earnings, adjusted for pretax gains, were $1.47 per share, 7 cents better than Wall Street expected, according to a Zacks Investment Research survey.

Revenue was $17.78 billion, also better than expected.

The company now expects earnings for the current fiscal year to be $5.30 to $5.50. Analysts had expected $5.28 per share.

Shares rose more than 5 percent before the opening bell.

© The Associated Press. All rights reserved.