Bayern Munich have signed Spain U-21 captain Thiago Alcantara from Barcelona on a four-year contract in a deal worth €25m, the European champions confirmed Sunday.

New Bayern coach Pep Guardiola had said last Wednesday that "it was Thiago or nobody" on his wish list of new players at the UEFA Champions League winners and the midfielder, who had also been linked with a move to Manchester United, will fly to Munich for his medical in the coming days.

Bayern will pay €20m for the 22-year-old with the extra five million coming from a future friendly match between the two clubs.

Thiago scored a first-half hat-trick for Spain in the final of last month's European U-21 Championships to claim a 4-2 win over Italy.

"Thiago Alcantara was the main wish of our new coach Pep Guardiola," Bayern chairman Karl-Heinz Rummenigge said.