Juventus have announced Massimiliano Allegri will leave his post as manager at the end of the season.

Allegri and the Juve board have had several meetings in the past few days over the former AC Milan boss’ future, and they decided he will step down after their final match of the season away to Sampdoria on May 26.

“Massimiliano Allegri will not be on the Juventus bench for the 2019-2020 season,” the statement on Juventus’ website read.

Allegri took charge of the Bianconeri in July 2014 after Antonio Conte resigned only days into preseason training. He was an unpopular choice among Juve fans at the time, given his past at AC Milan, whom he had led to the Serie A title in 2011 before being sacked midway through the 2013-14 campaign.

He managed to win most Juve supporters over, however, by guiding the Old Lady to five straight Serie A titles and leading them to the 2015 and 2017 Champions League finals, which they lost to Barcelona and Real Madrid, respectively. Allegri also won the Coppa Italia in his first four seasons in Turin — after Juventus had gone 20 years without winning Italy’s main domestic cup competition — but saw his side eliminated by Atalanta in this season’s quarterfinals.

Last summer’s signing of Cristiano Ronaldo was seen as a key to Juve finally lifting the Champions League for the first time since 1996, but despite making a remarkable recovery from a 2-0 first-leg defeat to eliminate Atletico Madrid in the round of 16, they were eliminated by Ajax in the quarterfinals, losing at that stage for the second season running following last year’s defeat to Real Madrid.

Allegri, 51, turned down a move to Real last summer in a bid to win the Champions League with Juve, but with the Spanish club now back in the hands of Zinedine Zidane, Allegri’s future could lie in the Premier League, where he has previously been linked with Chelsea.