Facebook’s earnings just hit the wire, showing $1.585 billion for the quarter and a grand total of $5.1 billion for all of 2012, narrowly beating estimates of $5 billion.

But the real standout line item was mobile advertising revenue — the most hotly anticipated and debated figure in Facebook’s books and the one where Facebook far outstripped any forecasts.

Here’s a quarter-by-quarter look at Facebook’s revenues over the past two years:

Obviously, the majority of this comes from advertising — and with its new Graph Search, Facebook is poised to take an even larger share of that market from reigning champion Google. In fact, Facebook CEO Mark Zuckerbrg said in today’s earnings call that he considers Graph Search the company’s most important product from the past 12 months and that he looks forward to building Graph Search into a meaningful part of Facebook’s business.

Online ads in the U.S. were a $10 billion market in Q4 2012, with Facebook taking home $1.33 billion of that — 13.3 percent of the total market. Advertising made up 84 percent of the company’s total revenue and increased 41 percent year-over-year for Q4.

News Feed ads “turned out even better than we thought,” said Zuckerberg. He said the company is working on more innovative and effective ad products. Facebook COO Sheryl Sandberg also noted that 65 percent of Facebook’s advertisers are using News Feed ads, which also run in mobile interfaces.

Mobile ads and revenues

As for mobile figures, mobile monthly active users were up to 680 million at the end of 2012, a 57 percent hike year-over-year. Mobile revenue made up nearly one quarter of all ad revenue in Q4 — a (relatively) huge $306 million.

While the analysts at eMarketer pretty much nailed their figures for 2012 revenues, they were surprised at how fast the social network’s mobile revenue has grown.

“The company outperformed expectations again — by a wide margin,” an eMarketer told VentureBeat today via email. “With 25 percent of revenue going to mobile in the fourth quarter, Facebook has cemented its position as the leader in mobile display advertising in the U.S. by a wide margin.”

Facebook’s entry into mobile advertising was a big part of the entire segment’s boom last year, an overall 180 percent increase in mobile ad spend in the United States.

eMarketer estimates that Facebook took home more U.S. mobile display revenue than any other mobile ad publisher in 2012, up to and including rival Google. The firm estimates Facebook earned 18.4 percent of the total U.S. mobile display ad market, up from 17 percent last year.

“The social networking giant offered no mobile ad opportunities at the beginning of 2012 but grew its mobile business at an astonishing — and unexpected — rate,” said an eMarketer rep.

“Before Facebook’s Q3 earnings call, most researchers and analysts expected U.S. mobile ad revenues of roughly $45 to $100 million, according to figures examined by eMarketer. While the company’s total ad revenues were, for the most part, unsurprising, the share of revenues attributed to mobile advertising was far from it.”

Share prices

Analysts had previously forecast Facebook’s 2012 revenues at $5 billion, a significant decrease from a previous $6 billion estimate. Facebook had underperformed analysts’ expectations in the first two quarters of 2012, and with the downgraded annual revenue estimate, share prices dipped below $18.

This morning, the company’s shares were trading at $31.28, their highest price since the stock’s nosedive came to a slow halt last fall. In after hours trading, prices dropped slightly to $30.71. Take a look at Facebook share price performance over the last six months:

This kind of uptick has put Facebook stock squarely in the “most improved” category for consumer-facing tech companies, with share prices rising around 35 percent in the past six months:

Shares have been closing above 13-day and 50-day exponential moving averages (EMAs), indicating bullish performance for the near future.

The company’s initial public offering saw shares trading in the low to mid-$40s before the bell; throughout the day and the months to follow, share prices dropped dramatically. However, as many analysts and investors pointed out, Facebook was and is still at the beginning, both in terms of share price and revenue.

“This is an eight-year-old company,” pointed out Rebecca Lieb, an Altimeter Group analyst. “When Google went public, they had only recently developed ad products. Facebook is at the beginning of mobile products, advertising products — and it hasn’t even started with commerce products.”

“Facebook has just scratched the surface of its revenue and advertising,” said Menlo Ventures managing director Mark Siegel. “They’re going to grow with a much more diverse income stream than what they have today.”

And speaking of diverse revenue streams, let’s take a closer look at one of the stars of today’s show: Facebook’s mobile revenue.

Gifts

Another entirely new line item on Facebook’s budget is Gifts, which the company launched to a small group of users near the beginning of Q3 2012. Initially, the service, which let users send physical gifts to one another and let Facebook keep a small cut of the profits, seemed like a great addition to Facebook’s revenue streams.

“Gifting is a very unique form of e-commerce, and we thought there was a lot more innovation that could be going on there,” said Gifts creator Lee Linden in a recent VentureBeat interview. While he couldn’t get specific about how much Facebook takes in the transactions, he did say, “We’re starting with the U.S., and we’ll evaluate in the future what makes sense,” indicating that the company does plan to go global with the new e-commerce product.

“I think these can be big opportunities for us in the long term,” said Zuckerberg, “but for the next year at least, our work around ads will have by far the biggest impact on our business.”