Apple replaced 11 million iPhone batteries during the length of its battery replacement program, even though it only expected to replace about 1 million to 2 million of them, according to well-connected Apple insider John Gruber.

Apple CEO Tim Cook revealed the figure during an all-hands meeting that was first reported by Bloomberg.

Apple's battery replacement program started last January and ran through Dec. 31. It allowed owners of the iPhone 6 and newer models to replace their battery for just $29.

The program was launched after Apple began to slow down the performance of devices that had aging batteries and were more prone to turn off without warning. Battery replacements helped iPhones operate at peak performance again.

It's one reason why Apple may have missed shipment estimates in its fiscal fourth quarter and why it will ship fewer than expected in the first quarter, Apple said.

On Jan. 2, Apple revised its revenue forecast for its fiscal first quarter. Cook attributed the lower-than-expected iPhone sales and lowered guidance to trade tensions with China and economic weakness.

"In addition, these and other factors resulted in fewer iPhone upgrades than we had anticipated," Cook explained.

Cook called out the iPhone battery replacement program in the same letter, when he said that "some customers [were] taking advantage of significantly reduced pricing for iPhone battery replacements." But, he didn't mention that Apple had expected about 10 million fewer customers to upgrade their batteries, as Gruber states.

Apple did not respond to requests for comment.

Subscribe to CNBC on YouTube.