Former European Cup winners AC Milan endured a bittersweet 3-2 win at SPAL in the last round of the Serie A, finishing the campaign outside the top four after their nearest rivals both booked their Champions League berths on Sunday.
The result left Milan fifth on 68 points, one behind third-placed Atalanta and fourth-placed city rivals Inter, meaning they will have to be content with the Europa League next season.
Atalanta came from behind to beat Sassuolo 3-1 at home while Inter eked out a 2-1 win against relegated Empoli at the San Siro.
"I am happy with the development of my players, I think many of them have improved a lot," said AC Milan coach Gennaro Gattuso, whose future with the club is uncertain. "We can still get better although it will not be easy to improve this season's 68 points.
"The biggest regret is that in the last few months we have not played well and we have lost too many points, but all in all our work has been good," he added. "There are regrets but also pride. I've congratulated the squad for what they have given me this season."
Hakan Calhanoglu fired Milan ahead in the 18th minute with a first-time shot from the edge of the penalty area after Franck Kessie played the ball into the Turkey midfielder's stride from the left flank.
Kessie doubled Milan's lead shortly afterwards when poor SPAL defending gave the Ivorian playmaker time and space to tee himself up for a left-footed shot into the roof of the net from close range.
The home side pulled one back in the 28th minute after left back Francesco Vicari found the top left corner with a glancing header and levelled early in the second half, Mohamed Fares meeting Alessandro Murgia's cross with a thumping header.
Kessie converted a 66th-minute penalty after Krzysztof Piatek was hauled down to rekindle Milan's hopes of earning Champions League football next season but their joy was short-lived as news of the other results came through.