The generation of clean and sustainable hydrogen fuel through water splitting demands efficient and robust earth-abundant catalysts for the hydrogen evolution reaction (HER). A new hybrid, which was fabricated by incorporating molybdenum carbide (Mo x C) nanoparticles into a nitrogen-implanted three-dimensional carbon matrix (MoCN-3D), was developed as a highly active and durable nonprecious metal electrocatalyst for HER. The porous architecture of MoCN-3D can provide continuous mass transportation with a minimal diffusion resistance and thus produce effective electrocatalytic kinetics in both acidic and alkaline media. Experimental observations in combination with density functional theory calculations reveal that the effective coupling between molybdenum carbide nanoparticles and the carbon matrix, as well as N hybrid coordination, can modify the electronic Fermi level of the final hybrid, which synergistically reduces the proton adsorption and the reduction barrier during electrocatalytic HER.