Facebook has agreed to buy Oculus for two billion dollars (£1.2bn), betting that its virtual reality technology may be a new way for people to communicate, learn or be entertained.

"This is a long-term bet on the future of computing," said Facebook chief executive Mark Zuckerberg. "I believe Oculus can be one of the platforms of the future."

Oculus, based in Irvine, California, makes the Oculus Rift, a virtual reality headset that has received a lot of attention from video game developers, but has yet to be released for consumers. The headsets cover a user's eyes and create an immersive world that reacts to turning your head or moving back and forth.

Beyond games, Mr Zuckerberg said virtual reality headsets might one day be used to enjoy a courtside seat at a basketball game, study in a classroom, consult a doctor face to face or shop in a virtual store. The technology also had social applications, he said.

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

It is Facebook's second big acquisition in as many months. Last month the social network announced that it would pay 19 billion dollars (£11.5bn) for mobile messaging start-up WhatsApp, a deal that has not closed.

"I don't think you should expect us to make multiple multi-billion dollar acquisitions within a couple of months frequently," Mr Zuckerberg said.

But he called Oculus a "unique" company with a major lead on rivals in technology, engineering talent and developer interest. Sony unveiled its own prototype virtual reality headset at a game-developers conference in San Francisco last week.

Mr Zuckerberg said virtual reality technology was a computing platform unto itself, comparing it to personal computers, which revolutionised the world in the 1970s and 80s, and mobile phones.

Facebook said the deal included 400 million dollars (£242m) in cash and 23.1 million shares worth about 1.6 billion dollars (£970m). Oculus staff are also eligible for an additional 300 million (£182m) if the company achieves certain targets.

Mr Zuckerberg said Facebook intended to let Oculus continue with its road map of development, but help out with recruiting, marketing, infrastructure and opening doors to new partnerships.

He said he intended not to make a profit on hardware but instead make the product affordable and ubiquitous so Facebook can look at generating revenue from services, software, advertising, virtual goods or other areas.