SAN FRANCISCO — A tiny Irvine company founded by a 21-year-old Cal State Long Beach drop-out may play a leading role in Facebook's next major bet on the future of the Internet: that virtual reality will change the way people experience the Web.

Facebook said Tuesday that it was buying Oculus VR, maker of virtual reality headsets for video game players, for $2 billion.

The ultimate goal of the acquisition, the giant social network said, is to create an immersive 3-D experience in which users don't just chat online with friends but grab a cup of coffee with them in a virtual cafe or travel with them to distant places, just by putting on a pair of goggles with dark lenses.

Virtual reality is no longer the stuff of science fiction and in coming years will fundamentally transform how people learn, communicate, seek out entertainment and experience the world, Facebook Chief Executive Mark Zuckerberg said during a conference call with analysts.

"Imagine not just sharing moments with friends online, but entire experiences and adventures," Zuckerberg said.

The surprise deal was Facebook's second blockbuster acquisition of the year, coming on the heels of its $19-billion deal to buy mobile messaging service WhatsApp.

Zuckerberg called it a "long-term bet on the future of computing," saying virtual reality has the potential to be "the most social platform ever."

Facebook, which was founded a decade ago when most people surfed the Web from desktop browsers, had to play catch-up as consumers shifted to mobile devices. Now it appears that Facebook is guarding against making the same mistake twice.

But analysts say Facebook may be backing the wrong technology.

"No one has any level of confidence that the next big computing platform is virtual reality," S&P Capital IQ analyst Scott Kessler said.

Despite years of hype, virtual reality has yet to find a mass following. By and large, consumers have not gone for headsets that come with video games or 3-D television. And Zuckerberg acknowledged that Facebook was years away from making virtual reality a compelling part of the Facebook experience.

"It feels like Facebook executives have sworn to never miss another big shift again. Only unlike mobile, virtual reality will only ever be a niche, even if it eventually becomes a very exciting one," Forrester Research analyst James McQuivey said in an email.

The Oculus acquisition includes $400 million in cash and 23.1 million shares worth about $1.6 billion. Oculus employees are also eligible for an additional $300 million if their company hits certain targets.

The high price may unnerve investors still trying to digest Facebook's acquisition of WhatsApp.

Shares of the Menlo Park, Calif., company fell 53 cents, or nearly 1%, to $64.36 in after-hours trading after closing up 79 cents at $64.89.

Wedbush Securities analyst Shyam Patil said many investors will be puzzled that Facebook is buying a virtual reality company. But, he said, Facebook may get the benefit of the doubt with Google Inc. making a major bet on wearable Internet-connected devices with Google Glass.

"There is a bit of validation out there from another major player," Patil said. "But it is a very long-term bet. It could make sense, but we won't know for a long time."

Oculus, which has raised more than $90 million, makes the Oculus Rift, a virtual reality headset that's yet to be released but is already a cult hit with video game developers.

Facebook said Oculus has received more than 75,000 orders for development kits for the headset, which sells for $350 apiece.

Antonio Rodriguez, an Oculus board member and general partner at Matrix Partners, said Oculus had outpaced competitors in virtual reality. Sony has its own prototype called Project Morpheus for the PlayStation 4.