Gundogan, 32, was offered a new contact by City but is thought to have negotiated a more lucrative three-year deal with the Spanish champions.
City boss Pep Guardiola was keen to keep Gundogan, who was integral to the club winning the Treble this season.
The Germany midfielder played 51 games in 2022-23, scoring 11 goals.
Gundogan’s influence was crucial in the closing weeks of City’s season with six goals in his final seven games – including a double in the 2-1 FA Cup final win over Manchester United.
He played 90 minutes in the Champions League final as City beat Inter Milan 1-0 to add to their Premier League and FA Cup triumphs this season.