Cytochrome c oxidase (CcO) is part of the respiratory chain and contributes to the electrochemical membrane gradient in mitochondria as well as in many bacteria, as it uses the energy released in the reduction of oxygen to pump protons across an energy-transducing biological membrane. Here, we use time-resolved serial femtosecond crystallography to study the structural response of the active site upon flash photolysis of carbon monoxide (CO) from the reduced heme a3 of ba3-type CcO. In contrast with the aa3-type enzyme, our data show how CO is stabilized on CuB through interactions with a transiently ordered water molecule. These results offer a structural explanation for the extended lifetime of the CuB-CO complex in ba3-type CcO and, by extension, the extremely high oxygen affinity of the enzyme.