Massmiliano Allegri appeared to be a dead man walking at AC Milan going into the end of the season, but he bought himself another year by finishing third in Serie A. AC Milan announced late on Sunday night that Allegri would remain with the club.

Allegri had been linked to AS Roma and would have likely taken over there had Milan opted to release him from his contract. He met with director Adriano Galliani on Friday before meeting with owner Silvio Berlusconi on Sunday to learn that he would stay on as coach.

Milan had a disappointing season, barely finishing third in Serie A. They were also knocked out of the UEFA Champions League in disappointing fashion, giving up a two-goal lead against FC Barcelona. However, Allegri was hamstrung early in the season when Berlusconi opted to sell the team's two best players, Thiago Silva and Zlatan Ibrahimovic, without spending a significant amount of money on quality replacements.

Follow @SBNationSoccer on Twitter | Like SB Nation Soccer on Facebook

More in Soccer:

• USMNT down Germany in a 4-3 thriller

• Recapping the last week in La Liga

• Bayern win historic treble

• Transfer rumours from SB Nation and our team blogs

• Full coverage of the NWSL