The 34-year-old left-back helped Spain to glory at the European Championship in 2008 and the World Cup in 2010, but struggled for form and fitness since arriving in Portugal last summer.
"The final agreement was signed [Friday] morning between the Catalan defender and the team," a statement on Espanyol's official website read.
"We are happy because he has had a long and fruitful career in the Spanish league."
Indeed, Capdevila made his first steps as a professional footballer at Espanyol after joining from home-town club Tarrega in 1997, and has gone on to play over 250 times in La Liga.
Espanyol start the new season away to Mallorca on the weekend of August 18.