The world's No. 1 social network also reported an uptick in daily visitors to its service, allaying worries that a new crop of fast-growing mobile upstarts like WhatsApp and Snapchat could cut into the time consumers spend on Facebook.
Facebook's growing appeal to consumers and advertisers combined to deliver the company's strongest ad revenue growth since the third quarter of 2011. Ad prices, which declined at Google and Yahoo, increased 13 percent at Facebook.
"Facebook has nearly 700 million people that use the platform daily. There's no bigger audience on the planet," said Jordan Rohan, an analyst at financial services firm Stifel Nicolaus.
Facebook said revenue from e-commerce companies doubled year-on-year in the second quarter, and the total number of ads displayed on its service expanded by 43 percent year-on-year.
The quarterly results, which also showed a spike in operating margin to 31 percent, shore up investors' confidence in a company which has struggled to fully regain credibility after a rocky May 2012 initial public offering. Despite Wednesday's rally, it remains nearly 20 percent below its debut price.
Mark Zuckerberg, the 29-year old chief executive who co-founded Facebook in his Harvard dorm room, said the company was beginning to reap the benefit of investments to retool certain products over the past 18 months, particularly the mobile version of its service.
"Coming into this year we could tell internally that we were turning a corner on that, that we were in good shape and could start to play a bit more offense," Zuckerberg said in a conference call with analysts on Wednesday.
With consumers increasingly accessing Web services on smartphones, whose smaller screens make it more challenging to display ads, Internet companies have struggled to adapt their businesses.
The newsfeed ads that Facebook has introduced over the past year inject marketing messages straight into a user's stream of news and content. Unlike Google's mobile ads, which generally command lower prices than the company's PC-based equivalent, Facebook's mobile newsfeed ads garner higher rates than its other forms of online ads, say analysts.
"Facebook is uniquely positioned because of the way consumers consume their content to show these types of ads," said Macquarie Research analyst Ben Schachter. "More and more people are finding that this is a useful place to show ads," he said.
Last week, Google reported second-quarter results short of Wall Street's estimates as weakening prices for its ads weighed on the bottom line, and Yahoo trimmed its 2013 sales outlook.
Teen users
Facebook said about 61 percent of its 1.15 billion users now visit the service on a daily basis, compared to 58 percent in the second quarter of 2012. That increase came despite worries that in-feed ads will alienate viewers, and that a new crop of mobile services popular among a younger crowd, such as Snapchat, would siphon off users.
Zuckerberg said Facebook had not experienced the feared flight of teenage users in the United States, noting that the number of teen users in the country on a daily and monthly basis had been steady over the past year and a half.
"You always have to keep an eye on it, but they're certainly not running out the door," said Jefferies analyst Brian Fitzgerald.
Shares of Facebook were up 16.7 percent at $30.95 in after-hours trading on Wednesday.
Facebook grew revenue 53 percent to $1.813 billion in the second quarter, above the average analyst expectation of $1.618 billion, according to Thomson Reuters I/B/E/S. Facebook had $1.184 billion in revenue in the year ago period.
The company said that mobile ads accounted for roughly 41 percent of its total ad revenue in the second quarter, up from 30 percent in the first quarter of the year.
Chief Operating Officer Sheryl Sandberg said the company had increased both the quantity and types of newsfeed adds during the second quarter, even as click-through rates and cost-per-clicks, or ad rates, remained strong.
"Right now, ads on average make up about 5 percent, or one in 20 stories on the newsfeed," Zuckerberg told analysts. "In recent studies, people have told us that they notice the ads more. So we're going to invest in improving the quality."
Facebook grew revenue 53 percent to $1.813 billion in the second quarter, above the average analyst expectation of $1.618 billion, according to Thomson Reuters I/B/E/S. Facebook had $1.184 billion in revenue in the year ago period.
© Thomson Reuters 2013
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.