Temperature dependences of the lattice parameters, magnetization and magnetic susceptibility have been measured for the ErFe2Hx hydrides with different hydrogen content x and for the ErFe2D3.1 deuteride. For the samples with a hydrogen content of about 3.1, structural transition from the cubic to the rhombohedral phase has been observed in the temperature range 280 – 310 K. Small variation of hydrogen content does not shift the transition temperature, but influences the amount of the low-temperature rhombohedral phase. The temperature dependence of magnetization shows up an anomaly in the range of the phase transition, which is due to the difference in the magnitudes of magnetic moments and exchange interactions in two phases. Structural and magnetic studies point to a diffusion nature of the phase transition. Upon heating the samples in vacuum there takes place decomposition of the hydride. The hydride with x = 1.6 which forms at the intermediate stage of decomposition possesses an ordering temperature higher than that for the parent ErFe2 compound.