He spent most of his career with Porto with whom he signed in 2007, going on to appear in 237 competitive matches and win 12 major titles, including four Primeira Liga championships and the 2011 Europa League. He also played professionally in England, Turkey and Spain, winning the domestic league twice with Galatasaray and the 2016 League Cup with Manchester City.