CUPERTINO -- After months of speculation that onerous pricing and sagging demand had eroded the magic formula that had made it the world's most valuable public company, Apple (AAPL) on Wednesday reported record profits for its holiday quarter, matching its earnings a year ago but slightly missing Wall Street's estimates.

Apple said it earned $13.81 a share on $54.5 billion in revenue for its first fiscal quarter ending Dec. 31. Analysts polled by Thomson Reuters had expected Apple to earn $13.47 a share on $54.7 billion.

A year earlier, Apple had posted record quarterly revenue of $46.3 billion and record quarterly net profit of $13 billion, or $13.87 per share. International sales, which accounted for 58 percent of the quarter's revenue a year ago, were up to 61 percent of the quarter's revenue.

Apple said it expects its coming quarter revenue to be between $41 billion and $43 billion with a gross margin at between 37.5 percent and 38.5 percent, which is less than analysts had been estimating.

Perhaps more important, Apple said it had sold a record 47.8 million iPhones in the quarter, compared to 37 million in the year-ago quarter. Analysts had expected between 46 and 47 million. Apple said it also sold a record 22.9 million iPads during the quarter, compared to 15.4 million in the year-ago quarter. But that number was slightly below analysts call for between 23 and 24 million tablets to be sold.

Apple managed to dodge a bullet with its profit number, barely exceeding matching earnings from a year earlier. If its profits had fallen short, it would have been the third consecutive quarter that Apple had come up short and the first time since 2003 that the company had seen a year-over-year drop in profits. That did not happen.

And CEO Tim Cook, who has been under intense pressure to bring back to Apple some of the excitement that was building during Steve Jobs' tenure.

"We're thrilled with record revenue of over $54 billion and sales of over 75 million iOS devices in a single quarter," Cook said in a statement. "We're very confident in our product pipeline as we continue to focus on innovation and making the best products in the world."

Apple's board of directors has declared a cash dividend of $2.65 per share of the Company's common stock. The dividend is payable on February 14, 2013, to shareholders of record as of the close of business on February 11, 2013.

Apple said its gross margin for the quarter was nearly 39 percent, a bit higher than analysts polled by Thomson Reuters had predicted. That number a year earlier had stood at almost 45 percent and many analysts were looking for something closer to 40 percent this time around.

Investors didn't like the result, immediately sending shares down more than 4 percent in after-hours trading.

Contact Patrick May at 408-920-5689 or follow him at Twitter.com/patmaymerc