Match ends, Everton 3, Crystal Palace 2.
Everton secured their Premier League status with an incredible fightback where they came from two goals down to beat Crystal Palace.
The hosts, who will continue their 68-year stay in the top flight, looked like they were heading for defeat after Palace scored twice in the first half through Jean-Philippe Mateta and Jordan Ayew.
But conjuring up a fighter's spirit once more and spurred on by their vociferous support, Everton turned the game around in the second half, thanks to a more attacking approach.
Nine minutes after the break Michael Keane smashed in to give Frank Lampard's side hope, and when Richarlison found the bottom corner with a deflected shot with 15 minutes left, it sent Goodison Park into raptures as a precious point looked likely.
Yet the best was to come with five minutes left. Dominic Calvert-Lewin, who scored his first goal since August against Brentford on Sunday during an injury-hit season, sparked pandemonium with a diving header from Demarai Gray's free-kick.
The excitement boiled over as fans descended on the pitch to celebrate, with blue mist shrouding the stadium as smoke flares were let off.
The crucial result avoided the kind of final-day nerves that Everton fans had to experience in 1998 and 1994, where the team also preserved their Premier League status.
This time, with a trip to Arsenal on Sunday, they can at least enjoy the fact that however tortuous this season has been, they will remain in the top flight, and will hope to build on the spirit shown in the closing stages of the campaign.
- Palace's Vieira involved in altercation with pitch invader
- 'A special night in Everton history - but we can't be here again'
- Visit our Everton page
- Go straight to all the best Crystal Palace content
The party started at the final whistle, with thousands of fans flooding onto the pitch, letting off more smoke flares, saluting their team and manager Lampard.
But he and the club will hope they will never have to cope with a similar scare again given lavish spending on players and a move to a new stadium in 2024.
Spirit from fans and players save Everton again
Lampard described this game as "all or nothing" given Everton's wretched away record, which has seen them win once on the road in the league since August.
And despite a poor showing in the first period, where once again Everton looked inferior to their opponents, they somehow managed another second-half turnaround, which has been crucial in keeping them in the Premier League.
The scenes at the final whistle were in stark contrast to those before the break where a tempestuous game boiled over on the pitch and left a livid feeling in the stands.
After the introduction of Dele Alli at the break and a move to a more attacking formation, Everton matched their second-half showings against Newcastle, Leicester and Chelsea, which earned two wins and a draw.
Lampard may well question why his side have to play poorly to find the inspiration, but boosted by a support which has had a massive role in their survival, they turned the game around against a Palace side which had beaten them twice already this season.
Palace dominate first half
Sunday's defeat by Brentford threatened to derail Everton's momentum gathered by their superior home form, but the hand that supporters have played in keeping the Toffees up cannot be underestimated.
Lampard and fans tried to evoke the spirit of recent matches from the start, with the team coach greeted by a wall of blue smoke outside the stadium.
That almost boiled over early on as Anthony Gordon and Wifried Zaha squared up to each other, causing a melee, but once Palace settled they quickly picked off an Everton side who struggled to keep the ball.
Lampard again favoured a 3-5-2 formation, but when his side retreated into a back five, Patrick Vieira's visitors were able to enjoy plenty of possession and control the game.
There were moments in first half for Everton's fans to get excited about, like Richarlison's free-kick that hit the bar.
But for the most part the passionate home support turned to anger as Mateta scored his seventh goal of the season before helping to create Palace's second.
The fact it came from Ayew was contentious. He had hacked down Gordon shortly before but only received a yellow card and was then on hand to take advantage as both Vitaliy Mykolenko and Abdoulaye Doucoure somehow failed to connect with the ball on the line following Zaha's shot.
That silenced the crowd, who must have felt like relegation was staring them in the face.
But a half-time switch to a back four by Lampard, who replaced the ineffective Andre Gomes with Alli, breathed life into Everton.
Nine minutes after the break, Keane fired in after Mykolenko's free-kick was headed back to the centre-back by Mason Holgate.
And with 15 minutes left, Everton managed to conjure up another goal. Alli had a hand in it, crossing the ball, but when the Palace defence failed to clear Richarlison's shot ended up in the bottom corner, setting off wild celebrations.
That seemed minor compared to Calvert-Lewin's winner. Everton fans could not contain their delight, running onto the pitch, with Zaha seeming to take issue with some supporters' attentions.
The pitch was eventually cleared, but there was little hope for the stewards as thousands celebrated with their heroes at the final whistle.
- 5KeaneBooked at 67mins
- 16DoucouréBooked at 82mins
- 21André GomesSubstituted forAlliat 45'minutes
- 24GordonSubstituted forGrayat 61'minutes
- 7RicharlisonSubstituted forKennyat 90+1'minutes
- 30van de Beek
- 12HughesBooked at 32minsSubstituted forMilivojevicat 57'minutes
- 15SchluppSubstituted forGallagherat 74'minutes
- 9J AyewBooked at 34mins
- 14MatetaSubstituted forBentekeat 81'minutes
- 11ZahaBooked at 69mins
- Anthony Taylor
- Shots on Target
Second Half ends, Everton 3, Crystal Palace 2.
Hand ball by Christian Benteke (Crystal Palace).
Foul by Christian Benteke (Crystal Palace).
Jordan Pickford (Everton) wins a free kick in the defensive half.
Foul by Conor Gallagher (Crystal Palace).
Mason Holgate (Everton) wins a free kick in the defensive half.
Substitution, Everton. Jonjoe Kenny replaces Richarlison.
Goal! Everton 3, Crystal Palace 2. Dominic Calvert-Lewin (Everton) header from the centre of the box to the bottom right corner. Assisted by Demarai Gray with a cross.
Foul by Wilfried Zaha (Crystal Palace).
Séamus Coleman (Everton) wins a free kick on the right wing.
Offside, Crystal Palace. Eberechi Eze tries a through ball, but Wilfried Zaha is caught offside.
Offside, Crystal Palace. Joachim Andersen tries a through ball, but Christian Benteke is caught offside.
Abdoulaye Doucouré (Everton) is shown the yellow card for a bad foul.
Eberechi Eze (Crystal Palace) wins a free kick on the left wing.
Foul by Abdoulaye Doucouré (Everton).
Substitution, Crystal Palace. Christian Benteke replaces Jean-Philippe Mateta.
Conor Gallagher (Crystal Palace) wins a free kick on the right wing.
Foul by Abdoulaye Doucouré (Everton).
Jordan Ayew (Crystal Palace) wins a free kick in the defensive half.
- Our coverage of your Premier League club is bigger and better than ever before - here's everything you need to know to make sure you never miss a moment