Serial femtosecond crystallography reveals the structural dynamics of photosystem II during the S-state transitions that produce dioxygen, providing insight into electron transfer, water insertion, proton release and O–O bond formation on sub-microsecond timescales.