The social media behemoth posted earnings of 97 cents per share, adjusted, on revenues of $6.44 billion in revenue in the second fiscal quarter. Analysts had expected 82 cents per share on revenues of $6.02 billion, according to a Thomson Reuters consensus estimate.
Shares rose nearly 6 percent after hours, briefly over $131 per share. The stock's all-time closing high during regular hours is $121.92.
"We're ... improving the experience for our community by helping them build more relevant and engaging ads," CEO Mark Zuckerberg told investors on a conference call.
Facebook's main money stream, ad revenue, hit $6.24 billion, versus the $5.8 billion expected by analysts surveyed by StreetAccount. Mobile ad revenue took the lion's share (84 percent) at $5.42 billion, versus the $4.84 billion expected.
That means mobile ad revenue is up 81 percent year over year, the company said.
Monthly active users hit 1.71 billion during the quarter, also topping the 1.69 billion estimate from StreetAccount. Daily active users hit 1.13 billion, above the 1.11 billion expected. Monthly users on mobile increased 20 percent year over year, and daily users on mobile increased 22 percent year over year, the company said.
That massive user base — and the mobile user data that comes with it — has not gone unnoticed by advertisers. Facebook was able to monetize those users more than expected, posting $3.82 average revenue per user, up from $3.32 last quarter and above the $3.59 expected.
"We've worked hard to make becoming an advertiser as easy as possible for businesses," Sheryl Sandberg , chief operating officer, said in a conference call. She cited ways to upsell businesses, such as targeting users who had filled out forms.
That could make it cheaper for a business like a car company to reach users interested in buying a car, Sandberg explained.
Facebook will take 67.9 percent of social-media advertising dollars worldwide this year, eMarketer estimates. Sharing has increased on Facebook and people are spending more time on its family of apps, CEO Mark Zuckerberg said last quarter.
"Clearly it was a stellar quarter — mobile advertising growth was significantly faster than the market expected," Mark Hawtin, investment director at GAM and Facebook shareholder, told CNBC's " Closing Bell " on Wednesday. "I think this is more about the pace with which they're taking their market. ... It's the speed with which it's happening that's immensely impressive."
Messenger, Facebook's stand-alone app, now commands a monthly audience of 1 billion mobile users, the company announced last week.
"The scale we've achieved with our messaging services makes it clear that it's more than just a way to chat with friends," Zuckerberg said, emphasizing the company's push into customer service and enterprise chat.
Plus as more users shift to mobile, it allows the company to sell more of the higher-priced ads that appear in those feeds, executives said on a conference call.
Zuckerberg said that how people share is evolving as the shift toward mobile continues, with more private messages, pictures and videos from smartphone cameras, and fewer words from hard-to-type-on touch screens.
Live video, virtual reality and messenger chatbots have been central to the company's strategy after its April developer conference .
"We're particularly pleased with our progress in video as we move towards a world where video is at the heart of all our services," Zuckerberg said in a statement.
Indeed, the company's capital expenditures grew "substantially" during the quarter as it beefed up infrastructure to support video, which is more taxing on the network, the executives said.
"While I'm happy with our progress, we have a lot more work to do. That means making big investments and taking risks," Zuckerberg said.
Still, unlike rival Twitter , which offered disappointing sales guidance on Tuesday, Facebook is not focusing too much on long-form content like live sports coverage, Sandberg said.
Wall Street was looking for a refresh on Facebook's user acquisition and engagement time , amid questions about whether mobile-first newcomers like Snapchat may pose a threat to Facebook's dominance . Also of note are Facebook properties Instagram, still considered the dominant photo-based digital ad platform with 500 million monthly users, and WhatsApp.
But the company said it continues to be the "best way to reach the largest global audience of teens and millennials," citing successful youth-targeted ads from brands like Jack in the Box.
Still, going forward, Zuckerberg and chief financial officer Dave Wehner were careful to emphasize that they aimed to keep the ad load from overwhelming users, shying away from formats like video pre-rolls. That may lead to lower successive growth rates in ad revenue starting next year, Wehner said.
Facebook's shares have traded near all-time intraday highs since last quarter's earnings, breaking above $122 this week. The stock is up a lofty 29 percent over the past year, setting a high bar after Facebook topped its last earnings reports.
It all comes as Facebook has changed up its corporate structure to allow Zuckerberg, who has pledged to give away 99 percent of his shares, to "remain involved with Facebook in a leadership role."
"Here's my problem with the company: I'm very concerned moving forward because of the attitude of the top level management, specifically Mark Zuckerberg," Julie Goodridge, CEO of NorthStar Asset Management and Facebook shareholder, told CNBC's "Closing Bell" on Wednesday. "The guy's done a great job. I have no complaints on what he's done so far, except he's got five people on his board, he has a super majority of shares and I'm worried. I'm worried about how are these guys going to pull off really good acquisitions, perhaps in the video portion of mobile broadcasting in a way that's going to increase their earning over the long term."