Just when investors were losing patience, Apple CEO Tim Cook managed to buy more time.

The gadget maker surprised the Street on Wednesday with strong profit and revenue growth, along with a grab bag of financial goodies that pushed the stock up nearly 8 percent in after-hours trading.

Apple expanded its already record-setting share buyback program by $30 billion, to $90 billion, and boosted its dividend by 8 percent.

The Cupertino, Calif., company also plans to split its stock seven-for-one in June — its first such move in nearly a decade.

Based on Wednesday’s closing price of $524.75 a share, the stock would be far more affordable and trade at around $75.

The effort was enough to appease critics who have been clamoring for Cook to return more money to shareholders while they wait for the next big thing.

“Agree completely with $AAPL’s increased buyback and extremely pleased with results,” tweeted activist investor Carl Icahn, who has been instrumental in pushing Cook to increase the share-buyback program.

Agree completely with $AAPL's increased buyback and extremely pleased with results. Believe we’ll also be happy when we see new products.