The La Liga club have signed the defender for the season who becomes a replacement for Shkodran Mustafi who joined Arsenal.
The defender joined Manchester City two seasons ago and played 64 times for the Citizens.
However, the Frenchman failed to impress at the Etihad and has not played under Pep Guardiola.
The writing was on the wall for Mangala when City signed John Stones, meaning first-team opportunities were bound to be limited.