Berlin: Schalke have confirmed that Germany midfielder Leon Goretzka will join Bayern Munich at the end of this season on a free transfer, with the Bundesliga leaders beating Liverpool to his signature.

“Leon Goretzka informed us at the start of the week that he wants to leave the club and will join FC Bayern,” said Schalke sporting director Christian Heidel.

“We did everything to keep Leon at Schalke.”

Goretzka, 22, has scored six goals in 12 appearances for his country and made his breakthrough at the 2017 Confederations Cup, where he helped a Germany side missing their World Cup-winning stars beat Chile 1-0 in the final.

The right-footed Goretzka joined Schalke from VfL Bochum in 2013 and has scored 19 goals in 130 games for the Royal Blues.

He can play as a deep-lying midfielder, winger or attacking midfielder and his versatility will be a bonus for Bayern.