Image source: Best Buy.

What: Shares of consumer electronics retailer Best Buy (NYSE:BBY) soared on Tuesday following the release of the company's second-quarter report. Best Buy beat analyst estimates on all fronts, posting positive comparable-sale growth and earnings that were well above expectations. At 11 a.m. ET, the stock was up about 17.5%.

So what: Best Buy reported second-quarter revenue of $8.53 billion, flat year over year and $130 million higher than the average analyst estimate. Comparable sales rose 0.8%, driven by a 23.7% rise in domestic online sales. Online sales accounted for 10.6% of domestic revenue during the quarter, up from 8.6% during the same period last year. This growth occurred against a backdrop of slumping industry sales, with NPD reporting a 3.2% second-quarter sales decline for consumer electronics.

Non-GAAP EPS came in $0.57, up from $0.49 during the prior-year period and $0.14 better than analysts were expecting. Lower operating costs, a lower tax rate, and a lower share count more than offset a slight decline in gross margin. On a GAAP basis, EPS was $0.56, up from $0.46 during the same period last year.

In addition to blowing past analyst estimates, Best Buy provided guidance calling for growth during the third quarter and the full year. Best Buy expects third-quarter comparable sales to rise 1%, with non-GAAP EPS between $0.43 and $0.47, up from $0.41 during the third quarter of 2015. For the full year, flat revenue is expected, but non-GAAP operating income is now expected to grow by a low single-digit percentage.

Now what: Online sales were the savior of Best Buy's quarter, helping the company post positive comparable-sales growth. E-commerce initiatives, like shipping from the store, have been a pillar of Best Buy's turnaround plan, and the acceleration of online sales during the second quarter is a sign that the company's strategy is working.

With demand for PCs still sluggish, and with the smartphone market growing far more slowly than in the past, Best Buy's positive results were a surprise. The company continued to execute well during the second quarter, keeping costs in check and growing categories like appliances. Best Buy still has a long road ahead as it transforms itself into an omnichannel retailer, but there was plenty of progress evident in its second-quarter results.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.