The effect of loss on quantum states is one of the major hurdles in quantum communications. A quantum error-correcting code that overcomes erasure due to photon loss is experimentally demonstrated. The scheme uses linear optics and protects a four-mode entangled mesoscopic state of light.