The Co-H system has been investigated through high-pressure high-temperature x-ray diffraction experiments combined with first principles calculations. On compression of elemental cobalt in a hydrogen medium, we observe fcc cobalt hydride (CoH) and cobalt dihydride (CoH2) at 33 GPa. Laser heating CoH2 in a hydrogen matrix at 75 GPa to temperatures in excess of 800 K, produces cobalt trihydride (CoH3) which adopts a primitive structure. Density functional theory calculations support the stability of CoH3. This phase is predicted to be thermodynamically stable at pressures above 18 GPa and to be a superconductor below 23 K as critical temperature, Tc. Theory predicts that this phase remains dynamically stable upon decompression above 11 GPa where it has a maximum Tc of 30 K.