Giovanni Martusciello ‘s side went into the final day with survival in their own hands, holding a one-point lead over Crotone either side of the dotted line.
Victory over already-relegated Palermo would have guaranteed Empoli’s place in the top flight for a fourth consecutive season, but they were beaten 2-1 at the Stadio Renzo Barbera.
Goals from Ilija Nestorovski and Bruno Henrique in the final 15 minutes put Empoli on the brink of relegation before Rade Krunic gave the visitors a glimmer of hope by pulling one back with three minutes remaining.
It was too little too late, though, as Crotone’s 3-1 win over 10-man Lazio ensured that Davide Nicola’s side completed a great escape on a final day having won six and lost just one of their final nine games of the season.
Crotone had just 14 points at the beginning of April but picked up 20 from the last 27 on offer – two more than champions Juventus in the same period – to pull off one of the most remarkable recoveries in Serie A history.
Elsewhere on the final day of the season, Roma icon Francesco Totti played his final 786th and final game for the club as they came from behind to beat Genoa 3-2 in dramatic fashion to secure second place ahead of Napoli, who overcame Sampdoria 4-2.
Inter Milan also ended their season on a high with a 5-2 home win over Udinese, while bottom-of-the-table Pescara earned a point away to Fiorentina.