SAN FRANCISCO — Facebook tapped Fenwick & West to advise it on its roughly $2 billion acquisition of Oculus VR, the startup behind the virtual reality Rift headset. Irvine-based company was advised by Bingham McCutchen. Its venture investors were advised by Goodwin Procter.

The $2 billion price tag includes $400 million in cash and 23.1 million Facebook shares valued at about $1.6 billion, with an additional $300 million earn-out payable in cash and stock if Oculus hits unspecified milestones. The transaction, announced Tuesday, is expected to close in the second quarter of 2014.