Software designer Julian Kantor (L), who created "The Recital" takes a picture of Jonathan Feng (R) as he uses the Oculus Rift virtual reality headset to experience his program during E3 in Los Angeles, California June 12, 2013. REUTERS/Gus Ruelas

By Alexei Oreskovic and Malathi Nayak

SAN FRANCISCO (Reuters) - Facebook Inc will acquire two-year-old Oculus VR Inc, a maker of virtual-reality glasses for gaming, for $2 billion, buying its way into the fast-growing wearable devices arena with its first-ever hardware deal.

The acquisition, which comes hot on the heels of its $19 billion deal for messaging service WhatsApp, marks a big bet by Facebook to anticipate the next shift in an evolving technology industry, at a time when consumers are increasingly abandoning their PCs for smartphones.

The world's largest social network was deemed late to recognize the shift to mobile devices and the company's revenue has only recently begun to recover from the late start.

Many in the industry believe that wearable devices could represent the next big platform shift. Google Inc has been testing Google Glass, a stamp sized electronic screen mounted to a pair of eyeglasses for several years. Last week, it introduced an effort to develop computerized wristwatches.

On Tuesday, Facebook said virtual-reality technology could emerge as the next social and communications platform.

"Mobile is the platform of today, and now we're also getting ready for the platforms of tomorrow," said Facebook founder and Chief Executive Mark Zuckerberg. "Oculus has the chance to create the most social platform ever, and change the way we work, play and communicate."

"After games, we're going to make Oculus a platform for many other experiences. Imagine enjoying a court side seat at a game, studying in a classroom of students and teachers all over the world or consulting with a doctor face-to-face -- just by putting on goggles in your home."

Oculus VR, founded by Palmer Luckey, a self-described virtual reality enthusiast and hardware geek, got its start as a Kickstarter-funded program, drawing small investments from thousands of people on the popular fund-raising platform.

It quickly drew attention to its "Oculus Rift" virtual-reality glasses, demoed at tech and gaming conventions around the country. It raised $75 million in December in a round led by Andreessen Horowitz, to market its virtual-reality headset for video games and develop the product for use in areas like education, film, architecture and design.

Other venture capital backers included Spark Capital, Formation 8 and Matrix Partners.

Oculus plans to produce commercial versions of its virtual reality glasses, called Oculus Rift, which users mount on their heads with a strap. It also hopes to take its technology beyond gaming.

Facebook ended 2013 with $11.45 billion in cash and marketable securities. The company's $19 billion acquisition of WhatsApp includes $4 billion in cash. The Oculus deal comprises $400 million in cash and 23.1 million shares of Facebook common stock.

The transaction is expected to close in the second quarter.

"Facebook understands the potential for VR. Mark and his team share our vision for virtual reality's potential to transform the way we learn, share, play, and communicate," Luckey and other co-founders said in a joint blogpost on Tuesday.

"Over the next 10 years, virtual reality will become ubiquitous, affordable, and transformative, and it begins with a truly next-generation gaming experience. This partnership ensures that the Oculus platform is coming, and that it's going to change gaming forever."

(Additional reporting by Lehar Maan in Bangalore, writing by Edwin Chan; Editing by Don Sebastian and Andrew Hay)