Apple iPhone sales hit an all-time high on Wednesday, helping to send its stock to its highest levels since the summer of 2015.

The company announced on Tuesday that it sold more than 78 million iPhones in the first quarter of fiscal 2017, compared to 74.78 million last year. Analysts had expected sales of 77.42 million, according to StreetAccount.

The news sent shares of Apple more than 6 percent higher, closing at $128.75 a share. The stock saw its best day since July 27, 2015 when it gained 6.5 percent.

Trade volume in shares of Apple was more than three times the 30-day average of 26.9 million shares. Apple has had the most positive impact on the , accounting for about 42 points of the Dow's gain on Wednesday.

"We sold more iPhones than ever before and set all-time revenue records for iPhone, Services, Mac and Apple Watch," said Tim Cook, Apple's CEO.