Social-networking leader Facebook (FB) revealed surging fourth-quarter profits on Wednesday that topped forecasts, as revenue soared 63% thanks to strong mobile advertising growth.

Shares of the Mark Zuckerberg company rallied about 8% on the stronger-than-expected results, which included solid user growth.

Facebook said it earned $523 million, or 20 cents a share, last quarter, compared with a profit of $64 million, or 3 cents a share, a year earlier.  

Excluding one-time items, it earned 31 cents a share, exceeding forecasts from analysts for 27 cents.

Gross margins expanded to 56% during the fourth quarter, up from 46% the year before. Analysts had projected more modest growth to just 49%.

Revenue climbed 63% to $2.59 billion, topping the Street’s view of $2.33 billion. Ad sales soared 76% to $2.34 billion, beating estimates for $2.11 billion.

Facebook continues to demonstrate its ability to monetize its mobile offerings. The company said mobile ad sales made up 53% of total ad sales last quarter, compared with just 23% the year before.

That translates to total mobile ad sales of $1.24 billion, which is higher than the $1.1 billion analysts called for.

Mobile monthly active users increased 39% year-over-year to 945 million as of December, while mobile daily active users averaged 556 million, up 49% from the year before.

Highlighting how Facebook has become a utility for many users, the company said its daily active users averaged 757 million in December, up 22% year-over-year. That means Facebook added roughly 139 million daily active users over the course of the year.

Facebook said its average revenue per user climbed to $2.14 during the fourth quarter from $1.54 the year before.

Payments and other fees revenue stood at $241 million.

"It was a great end to the year for Facebook," Zuckerberg said in a statement. "We're looking forward to our next decade and to helping connect the rest of the world."

Facebook said costs and expenses jumped 37% year-over-year to $1.45 billion due to increased headcount and higher infrastructure costs. Excluding share-based compensation and related payroll tax expenses, non-GAAP costs and expenses increased 33% to $849 million.

Shares of Menlo Park, Calif.-based Facebook climbed 8.71% to $58.19 in after-hours trading, bouncing back from a 2.92% decline during regular action. That puts Facebook on track to extend its 12-month rally of about 70% as of Wednesday's close. 

Follow Matt Egan on Twitter @MattMEgan5