As momentum picked up this week for sales of the newest Apple iPhones, the surge in its shares accounted for a good part of the broader stock market gains.
Shares jumped 11.4 percent for the week, their best since October 2011, while the Dow Jones industrial average and the closed just slightly higher for the week.
The iPhone maker accounted for about 80 points of the Dow's 127-point gain for the week, or more than half.
Apple was also responsible for about 60 percent of the S&P 500's weekly gain of 0.53 percent, with the technology sector surging 3 percent as the best performer.
Without Apple, the tech sector would have gained just 1.57 percent and the S&P 500 would have gained just 0.19 percent, according to Howard Silverblatt, senior index analyst at S&P Dow Jones Indices.
The sharp jump in Apple's shares also helped lift semiconductor stocks. Supplier Skyworks gained nearly 14 percent for the week, its best since April 2014. The iShares PHLX Semiconductor ETF (SOXX) gained 4.2 percent for its best week since late May.
With the gains in Apple, semiconductor stocks and the biotech sector, the Nasdaq composite outperformed, jumping 2.3 percent for its best week since July 1. The iShares Nasdaq Biotechnology ETF (IBB) rose more than 4.5 percent for the week.
Apple shares had lackluster performance after the company unveiled the iPhone 7, iPhone 7 Plus and wireless headphones on Sept. 7. Shares fell more than 2 percent last Friday as the three major indexes also fell more than 2 percent in their worst day since June 24.
Volatility picked up this week in the broader stock market, under pressure from lower oil prices and concerns about when the U.S. Federal Reserve might raise rates, But Apple's stock gained more than 2 percent every day of this past week except Friday. That's the first such win streak since April 2009.
The company said Wednesday initial quantities of the iPhone 7 Plus sold out globally, and U.S. carriers such as Sprint and T-Mobile reported strong pre-orders earlier in the week. Apple said it would not release first weekend sales figures for the newest iPhones, which hit stores Friday.
—CNBC's Gina Francolla and Chris Hayes contributed to this report.