Barcelona have signed Ilkay Gundogan on a free transfer after his departure from treble winners Manchester City with the German midfielder signing a two-year contract, the LaLiga club said on Monday.