Construction of electrocatalysts with exceptional intrinsic activity and rich active sites has proved to be an effective strategy for remarkably enhancing the activity of the hydrogen evolution reaction (HER). In this work, durable and highly efficient layered Re2P/ReS2 (RePS) heterostructures were successfully fabricated by an in-situ phosphating layered ReS2. Taking advantage of the unique layered structure can provide abundant reaction active sites and the strong electronic interaction between ReS2 and Re2P can enhance the intrinsic activity, the optimized RePS electrocatalysts show superior catalytic activities of 69 and 57 mV at 10 mA cm−2 for HER in alkaline and acidic media, respectively. The density functional theory results suggest that the formed heterostructures between ReS2 and Re2P play an important role in optimizing the catalytic kinetics of the electrocatalysts. This work not only demonstrates that modulation of the electronic structure of catalysts is an efficient way to improve the HER activity but also confirms that the layered RePS heterostructure is a promising candidate for robust and high performance HER catalysts.