By Chloe Aiello

Facebook soared in extended trading on Wednesday after reporting better-than-expected fourth-quarter earnings, and revenue that beat Wall Street forecasts for the first time in two quarters.

Facebook ($FB) reported earnings per share of $2.38 on revenue of $16.91 billion. That topped analysts' expectations for $2.19 earnings per share on $16.4 billion in revenue, according to Thomson Reuters. Facebook also beat on ad revenue, reporting $16.64 billion, which exceeded the Street's forecast of $16.25 billion.

Facebook added that 93 percent of advertising revenue came from mobile advertising, up from about 89 percent last year.

Facebook said revenue was up 30 percent year-over-year. The social media giant also reported an increase in daily active users to an estimated 1.52 billion in December ー about a 9 percent increase from the prior year. Active users are an important metric of success and audience engagement for social media companies.

Looking ahead to the first quarter of 2019, however, Facebook said it expects total revenue growth to decelerate "by a mid-single-digit percentage," and continue along that trajectory throughout the rest of the year.

Facebook’s report closes out a tough year for the social media company. Its stock has dropped more than 12 percent in the past 12 months amid a series of damaging data privacy and political scandals, from Russian trolls using the platform for coordinated misinformation campaigns to the improper harvesting of data.

Most recently, TechCrunch reported that Facebook has been paying users aged 13 to 35 to install a VPN that allows the company to essentially spy on their mobile activity. The VPN is similar to an app Apple ($AAPL) banned from its store in June.

All of this scandal has sparked heightened scrutiny and a sliding stock price. But despite the negative press, many analysts still viewed Facebook as a “buy” heading into earnings thanks to the popularity of Instagram, the monetization opportunities in Stories and Messenger, and Facebook’s reduced stock price.

“We think 2019 is likely to end better for FB than it started,” Bank of America analysts wrote in a note. “Our core view is that stories and video usage could stabilize/improve FB engagement, while greater monetization of stories, messaging and video, plus easier comps could stabilize revenue growth in the back half of 2019.”

Michael Robinson, an analyst at Money Map Press, said he doesn't think Facebook is in the clear just yet, as the company and CEO Mark Zuckerberg continue to deal with scrutiny and threat of regulation.

"It's not just about earnings and sales, of course, those are great ... I don't have a sense that the company, particularly with Zuckerberg there, [has] a path to deal with all these privacy problems," Robinson said. "And what is the plan for dealing with Congress? I think that if you are going to buy this stock for the long haul, you'd have to be patient because I don't know that we are necessarily out of the woods in terms of the stock's performance."