Quantum computing becomes viable when a quantum state can be preserved from environmentally-induced error. If quantum bits (qubits) are sufficiently reliable, errors are sparse and quantum error correction (QEC) is capable of identifying and correcting them. Adding more qubits improves the preservation by guaranteeing increasingly larger clusters of errors will not cause logical failure - a key requirement for large-scale systems. Using QEC to extend the qubit lifetime remains one of the outstanding experimental challenges in quantum computing. Here, we report the protection of classical states from environmental bit-flip errors and demonstrate the suppression of these errors with increasing system size. We use a linear array of nine qubits, which is a natural precursor of the two-dimensional surface code QEC scheme, and track errors as they occur by repeatedly performing projective quantum non-demolition (QND) parity measurements. Relative to a single physical qubit, we reduce the failure rate in retrieving an input state by a factor of 2.7 for five qubits and a factor of 8.5 for nine qubits after eight cycles. Additionally, we tomographically verify preservation of the non-classical Greenberger-Horne-Zeilinger (GHZ) state. The successful suppression of environmentally-induced errors strongly motivates further research into the many exciting challenges associated with building a large-scale superconducting quantum computer.