The oxygen-deficient double perovskite YBaCo2O5, containing corner-linked C
oO5 square pyramids as principal building units, undergoes a paramagnetic t
o antiferromagnetic spin ordering at 330 K. This is accompanied by a tetrag
onal to orthorhombic distortion. Below 220 K orbital ordering and long-rang
e Co2+/Co3+ charge ordering occur as well as a change in the Co2+ spin stat
e from low to high spin. This transition is shown to be very sensitive to t
he oxygen content of the sample. To our knowledge this is the first observa
tion of a spin-state transition induced by long-range orbital and charge or
dering.