AC Milan secured third spot and a place in the Champions League after coming from behind to win 2-1 at Siena in the final Serie A round of the season.
Fiorentina crushed Pescara 5-1 but remained in fourth spot and will play in the Europa League next season.
Mario Balotelli levelled for Milan from the penalty spot six minutes from fulltime, and Philippe Mexes scored the winner three minutes later.
More From This Section
Udinese took the second Europa League berth after winning 5-2 at Inter Milan for its eighth successive victory.
Milan's achievement is impressive considering numerous top players, including Zlatan Ibrahimovic and Thiago Silva, left the club in the last offseason.
The team was 15th in October but has charged up the standings, losing only three times in the league since. It went into the final round of matches protecting a two-point lead over Fiorentina, with both sides visiting already-relegated clubs.
Siena goalkeeper Gianluca Pegolo denied Robinho and Balotelli in the opening minutes, and did even better to palm Robinho's fierce strike round the post in the 21st minute. Siena took the lead when Claudio Terzi was left unmarked to head in Alessandro Rosina's pass over the defense in the 26th.
Milan coach Massimiliano Allegri brought on Giampaolo Pazzini and Stephan El Shaarawy for M'Baye Niang and Antonio Nocerino in the second half.
However, Ambrosini was sent off for a second booking after a sliding tackle on Adrian Calello in the 69th. Siena was also harshly reduced to 10 men when Terlizzi was shown a second yellow for clattering into Pazzini.
Milan was awarded a penalty when Dias Felipe hauled down Balotelli. The Italy striker has never missed a penalty in his professional career and he duly converted his 23rd from the spot. He has now scored 12 goals in 13 games for Milan.