<p>MUNICH — Javi Martinez will leave Bayern Munich at the end of the season after nine years and almost certainly nine Bundesliga titles, the German club said Tuesday.</p>
<p>The Spanish defensive midfielder joined Bayern in 2012 from Athletic Bilbao for what was then the German club’s record fee of 40 million euros ($48 million). His contract is due to expire June 30 and Bayern said “the club and player have mutually agreed not to extend his contract.”</p>
<p>Bayern has won the Bundesliga every season since Martinez arrived and can pick up a ninth consecutive title on Saturday if it beats Borussia Mönchengladbach or if second-place Leipzig loses at Borussia Dortmund. Bayern has a seven-point lead with three rounds remaining.</p>
<p>Martinez helped Bayern win the Champions League in 2013 and again last year, and he twice scored the winning goal in the European Super Cup.</p>
<p>The 32-year-old Spaniard has been more of a fringe player for Bayern in recent seasons. Of his 17 Bundesliga games this season, all but four have been as a substitute.</p>
<hr />
<p>More AP soccer: <a href="https://apnews.com/hub/soccer">https://apnews.com/hub/soccer</a> and <a href="https://twitter.com/AP_Sports">https://twitter.com/AP_Sports</a></p>