Best Buy raised its full-year profit and revenue outlook on Tuesday as the nation's largest consumer electronics chain delivered second-quarter results that beat Wall Street estimates.

Best Buy raised its full-year profit and revenue outlook on Tuesday as the nation's largest consumer electronics chain delivered second-quarter results that beat Wall Street estimates.

The results offer strong signs that Best Buy Co. has been able to fight off online leader Amazon.com as well as increasing competition from Walmart.

Skeptics had been prepared to write Best Buy's obituary just a few years ago, predicting it to follow its now defunct former rival Circuit City as it battled the penchant of shoppers to use the store as a browsing showroom and then buy online. Under its CEO Hubert Joly, who took the helm in 2012, the company has been cutting costs and improving stores and training. Best Buy is also working to forge deeper partnerships with its suppliers, and offering more online services. The company is also rolling out a free service this fall where sales people sit with customers at their home to offer product recommendations. It had been testing the service in several cities. That compares with its Geek Squad service, which offers tech repairs and at home installations for a fee.

Best Buy turned in a 5.4 percent increase in revenue at its U.S. stores opened at least a year for the fiscal second quarter. That beat Wall Street estimates for a 2.2 percent increase. And online sales soared 31.2 percent.

Best Buy said that comparable sales growth in computing, wearables, smart home, mobile phones and appliances was partially offset by declines in tablets.

Best Buy joins as a string of other major traditional retailers including Walmart, Target, Home Depot and Lowe's that all turned in gains for a key revenue metric for the quarter. That underscores that overall retailing isn't dead and that consumer spending remains solid despite reports of store closings.

"Against a backdrop of continued healthy consumer confidence, we believe broad-based product innovation is resonating with consumers and driving higher spend," said Joly in a statement.

For the period ended July 29, Best Buy earned $209 million, or 67 cents per share. Earnings, adjusted for one-time gains and costs, were 69 cents per share.

That was better than the 63 cents per share that analysts surveyed by Zacks Investment Research were calling for.

Revenue for the Richfield, Minnesota-based company totaled $8.94 billion, topping the $8.66 billion that analysts polled by Zacks predicted.

For the current quarter ending in November, Best Buy expects earnings in a range of 75 cents to 80 cents per share. Analysts polled by FactSet anticipate earnings of 65 cents per share.

Revenue is expected between $9.3 billion and $9.4 billion. Analysts surveyed by Zacks foresee revenue of $8.98 billion.

For the full year, the company now expects revenue growth of 4 percent, up from its original estimate of 2.5 percent. It also expects income growth of 4 percent to 9 percent, compared to its previous estimate for 3.5 percent to 8.5 percent growth.

Shares declined nearly 3 percent in Tuesday premarket trading.