Best Buy Co. Inc. (NYSE:BBY) reported better-than-expected quarterly earnings and sales for the second quarter of its fiscal year. Best Buy earned $209 million in the quarter ended July 29, up 6 percent from $198 million in the same quarter of last year. On an adjusted basis, the company earned 69 cents per share in the quarter, higher than the 63 cents forecast by analysts. Best Buy’s revenue rose 5 percent to $8.9 billion.

The Richfield-based retailer posted a 5.4 percent rise in comparable sales in the quarter, beating analysts’ average expectation for a 2.1 percent increase. It was the company’s biggest quarterly sales jump in seven years. The growth came from a variety of categories, including computing, wearables, smart home, mobile phones, and appliances. Online sales rose 31 percent.

The electronics retailer also raised its sales and profit guidance for the second half of its fiscal year, when launches of a new iPhone and Samsung Galaxy Note are expected to help drive sales. Sales in the first half of the year tend to be mostly from tech enthusiasts. The second half of the year is dominated by gift givers.

Best Buy, the No.1 U.S. electronics retailer, has stepped up investments in its e-commerce and supply chain divisions. The company said it now plans to spend $700 million in investments this year, up from its initial plan of $650 million. The company will use an additional $600 million in cost cuts over the next few years to help pay for the investments. During a conference call with analysts, CEO Hubert Joly said the retailer is more focused on growing overall revenue rather than profit margin rates.

One of the investments Best Buy is making is an in-home adviser program. The service sends specially trained employees to customers’ homes for free consultations on what products and services they could utilize in their home. Best Buy said the service has brought incremental sales and has led to higher conversion rates and order sizes than in stores. The company has been testing the program in five markets and plans to roll out the service to all major U.S. cities next month.

Best Buy’s stock has been trading at or near record highs in recent months, but fell 11 percent after the earnings announcement. Joly noted that the retailer’s stock is often erratic after it reports quarterly results. He said, “After five years of doing this at Best Buy, predicting what the share price does on the day of earnings is incredibly difficult.” Best Buy’s stock price has risen in the last year from about $35 to a range of $55 to $60.