The internet has bred new commerce giants and forced retailers to reinvent themselves.

Apple to the rescue.

Best Buy posted a surprise pop in second-quarter sales today (Aug. 25), as the electronics chain cut costs and benefited from a surge in demand for big-screen TVs and appliances. But the real bump seems to be coming from the retailer’s increasingly cozy relationship with Apple, which is giving more people a reason to step foot into the big-box stores.

Best Buy recently broke ranks with Wal-Mart and other big-box retailers to start accepting Apple Pay, and this month it became the first retailer outside of Apple’s own stores to sell the Apple Watch.

Best Buy CEO Hubert Joly spent much of his earnings call with Wall Street analysts praising the Cupertino, California-based company, mentioning Apple more than a dozen times in an hour’s time.

During the call, Best Buy announced plans to roll out sales of the Apple watch across 1,050 stores by the end of September because “demand for [the] Apple watch has been so strong,” Joly said.

The retailer is overhauling 740 Apple departments within its stores, to install new, Apple-approved fixtures with more display tables for phones, computers, and tablets. It also will begin selling Apple Care warranties with the hopes of offsetting its own declining warranty business.

Joly emphasized how working more closely with Apple and other “key vendors” is a major part of the retailer’s strategy to drive more shoppers into its stores and reboot years-long traffic declines. ”It’s more than just about the physical layout in the stores, these are close partnerships,” Joly said.

Apple has a reputation of being very demanding, and hitching Best Buy’s star to another retailer with its own stores and priorities always comes with risks.

But Joly said the launch of the iPhone 6 last year was a substantial traffic driver, boosting revenue (though not necessarily profits), “and we can all agree the Apple watch is iconic, and having it in all 1,000 stores by the end of September is a big deal for us.”

It might have turned out differently. Just three years ago, The Wall Street Journal called the 2012 holiday season a “do or die” quarter (paywall) for Best Buy.

Its then-CEO had resigned after having an affair with a subordinate, and the company was hemorrhaging sales to Amazon. In the past three years, Joly has led a turnaround plan that’s included shuttering stores, refocusing on customer service, and perhaps most importantly, overhauling its e-commerce operations and supply chain to make for faster checkout, better service, and more personalized offers.

The retailer isn’t out of the woods yet. Last year’s sales were still 20% below what the retailer did in 2011. And the threat from Amazon and other e-commerce companies shows no signs of abating.

“We have a long way to go but I’m very proud of where we are,” Joly told analysts.

The company is cautious about how the recent volatility in the financial markets will affect overall spending and said it expects sales to be flat in the third quarter.