Over the last half decade, few stocks have been more beloved by investors and Wall Street analysts than Facebook. No wonder: After a rocky initial public offering in 2012, it has rolled over one obstacle after another, including the shift to mobile computing and the rise of photo sharing. It delivered revenue and user growth that surpassed even the most optimistic projections.

By the end of last year, Facebook had 2.2 billion active users. Its stock rose 53 percent last year, single-handedly accounting for 3.7 percent of the 21.8 percent gain in the Standard & Poor’s 500-stock index, according to S.&P. Dow Jones Indices. By early February, its market capitalization had surpassed $560 billion, making it the fifth most valuable company in the index.

By then Facebook alone accounted for nearly 2 percent of the S.&P. 500 index, which means that anyone who owns a broad-based stock mutual fund or index fund probably owns Facebook shares. Sophisticated investors and institutions, too, have considerable exposure: Goldman Sachs analysts reported last month that Facebook was the second most widely held stock (after Amazon) by hedge funds.

Over 90 percent of Wall Street analysts covering the company deemed Facebook a “buy” in early February, even though, at $195 a share, its price-to-earnings ratio, a common valuation measure, was a lofty 35. (The average ratio now is about 24; historically, it has been about 15.)