2H-MoS2 is one of the most promising noble-metal-free electrocatalysts for the hydrogen evolution reaction (HER). A widely accepted view on its HER mechanism is that its edge site possesses high HER activity, whereas its basal plane is inert during the HER. Here, we confirm that the view is problematic. Results based on first-principles calculations and in situ attenuated total reflection surface enhanced infrared absorption spectroscopy and X-ray absorption fine structure measurements identify the transient phase-transition behaviour, which enables the partial basal plane of 2H-MoS2 to exhibit high HER activity. Specifically, during the HER, MoS2 can undergo a local phase transition from the inert 2H phase for the HER to the 1T′ phase with high HER activity, and the phase transition is transient—it recovers to the 2H phase after the reaction. This work reports a new reaction mechanism (i.e., the transient phase transition) and thus opens new opportunities for heterogeneous electrocatalyst design and mechanistic investigation into heterogeneous electrocatalysis.