After underwhelming results from Apple Inc, Google Inc and other big tech names, investors finally found a friend in Facebook Inc after the company shredded Wall Street's forecasts for revenue, profit and user growth.

Facebook's shares, which touched a record high of $120.79 on Thursday, closed up 7.2 percent at $116.73, giving a $22 billion boost to the social networking company's market value.

"FB remains in a class by itself across the combination of scale, growth, and profitability," J.P. Morgan Securities analyst Doug Anmuth said in a research note.

"While there are broader concerns of macro softness toward the end of 1Q, Facebook isn't seeing them."

Apple lost about $36 billion in market value on Wednesday after it reported disappointing earnings the previous day, while Alphabet shed nearly $30 billion after missing expectations.

Analysts don't see Facebook's growth slowing anytime soon as it grabs a bigger share of the advertising market, particularly on mobile devices.

At least 26 brokerages raised their price targets on Facebook's stock, with RBC the most bullish at $165. The median price target is $145, according to Thomson Reuters data.

"Facebook continues to generate very high and very profitable growth. An extremely rare combination. And we see in FB plenty of strong, secular platform growth ahead," RBC Capital Markets analyst Mark Mahaney wrote in a note to clients.

Facebook's ad revenue jumped 57 percent to $5.2 billion in the first quarter as the company's growing user base lured more advertisers to its platforms.

Mobile ad revenue accounted for about 82 percent of total ad revenue, up from about 73 percent a year earlier.

The company said about 1.65 billion people were now using Facebook at least once a month.

"As long as the users are there, FB will find ways to monetise," said Macquarie analyst Ben Schachter.

Facebook has become one of the biggest beneficiaries as advertisers move money away from TV to Web and mobile platforms.

Mahaney noted Facebook was developing better solutions for advertisers and investing in opportunities such as video ads, its messaging platforms WhatsApp and Messenger, photo-sharing app Instagram and virtual reality.

All this puts Facebook on track to capture 18 percent of ad spending with digital media owners in countries outside of China this year, nearly double the 10 percent share the company held in 2014, Pivotal Research analysts said.

Of the 49 analysts covering the stock, 45 rate it "buy" or higher, according to Thomson Reuters data.