Berlin (AFP) – Bayern Munich confirmed Tuesday that veteran Spanish midfielder Javi Martinez will be the third member of their treble-winning squad to leave the club world champions at the end of the season, along with head coach Hansi Flick.

Martinez joined in 2012 from Athletic Bilbao for a then-club record of 40 million euros ($48 million), winning the Bundesliga in all eight seasons he has so far completed in Germany.

Bayern, and Martinez, are on the brink of winning a ninth straight league title this Saturday.

The Spain international was also part of the Bayern squads which won the treble of Bundesliga, German Cup and Champions League titles in 2013 and 2020.

Headed goals by Martinez helped Bayern win the UEFA Super Cup in both 2013, against Chelsea in Prague, and again in 2020, against Sevilla in Budapest.

“I’m very proud and happy to have been part of the FC Bayern family for nine years… and am very happy about the many titles we won together,” said Martinez in a statement.

He joins defenders Jerome Boateng and David Alaba who are also out of contract at the end of the season, while Flick has asked to be released.

RB Leipzig coach Julian Nagelsmann has already been named as Flick’s replacement for 2021/22.

Alaba, 28, is reportedly set to join Real Madrid after failing to agree to a contract extension with Bayern, while Martinez and Boateng, both 32, have not been offered new deals.

Like Martinez, Alaba and Boateng were key members of the Bayern squads which twice won the treble.

“At the end of this season Martinez, Alaba, Boateng and Flick will be given a fitting farewell by FC Bayern in recognition of their great achievements for the club,” Bayern said in a statement.

Martinez has made 266 appearances for Bayern, but this season he has started only four Bundesliga games and one Champions League match with Leon Goretzka and Joshua Kimmich preferred in midfield.