Vertebrates use the mannose 6-phosphate (M6P)-recognition system to deliver lysosomal hydrolases to lysosomes. Key to this pathway is N-acetylglucosamine (GlcNAc)-1-phosphotransferase (PTase) that selectively adds GlcNAc-phosphate (P) to mannose residues of hydrolases. Human PTase is an α2β2γ2 heterohexamer with a catalytic core and several peripheral domains that recognize and bind substrates. Here we report a cryo-EM structure of the catalytic core of human PTase and the identification of a hockey stick-like motif that controls activation of the enzyme. Movement of this motif out of the catalytic pocket is associated with a rearrangement of part of the peripheral domains that unblocks hydrolase glycan access to the catalytic site, thereby activating PTase. We propose that PTase fluctuates between inactive and active states in solution, and selective substrate binding of a lysosomal hydrolase through its protein-binding determinant to PTase locks the enzyme in the active state to permit glycan phosphorylation. This mechanism would help ensure that only N-linked glycans of lysosomal enzymes are phosphorylated.