  Entanglement represents one of the most important conceptual advances in
physics during the last century and is also one of the most essential resources
in quantum information science. However, entanglement is fragile and its
potential advantages in applications are hindered by decoherence in practice.
Here, we experimentally realize entangled logical qubits (ELQ) with a bosonic
quantum module by encoding quantum information into spatially separated
microwave modes. The entanglement is protected by repetitive quantum error
correction, and the coherence time of the purified ELQ via error detection is
improved by 45$\%$ compared with the unprotected ELQ and exceeds that of the
entangled physical qubits. In addition, violation of the Bell inequality by
logical qubits is demonstrated for the first time with the measured Bell signal
B=2.250$\pm$0.019 after purification, surpassing the classical bound by 13
standard deviations. The protected ELQ could be applied in future explorations
of quantum foundations and applications of quantum networks.
