High-pressure X-ray diffraction studies have been performed on YbH2 up to 28 GPa. A first order phase transition from an orthorhombic structure to a collapsed hexagonal structure with c/a = 1.34 has been observed at about 15 GPa. The transition is accompanied by a 5.2% decrease in volume. Fitting the V(P) data to Murnaghan's equation of state yields the bulk modulus B0 = 40.2 GPa and its pressure derivative B'0 = 4.75 for the orthorhombic phase. For the hexagonal phase we find the bulk modulus to be B = B0 = 138 GPa independent of pressure, i.e. B'0 = 0.