The Merseyside club's 69-year stay in the top flight was in peril at halftime as they were drawing 0-0 and 2016 champions Leicester were ahead against West Ham United.
That combination of results meant Everton were in the relegation zone but Abdoulaye Doucoure's stunning 57th minute right-foot strike from outside the area earned Everton the victory they required.
With Leicester winning 2-1 and that game over, Everton fans then had to bite their fingernails, pray, or just simply not watch the 10 minutes of stoppage time which included a superb save by Everton goalkeeper Jordan Pickford.
The final whistle prompted a pitch invasion with smoke from blue flares drifting across the old stadium that will host top-flight football again after another Everton escape.
Leeds, the other club in the last-day relegation drama, went down with a whimper as they were hammered 4-1 at home by Tottenham Hotspur for whom Harry Kane scored twice.
Everton ended in 17th place on 36 points after 38 games, with Leicester in 18th on 34 and Leeds on 31.
Southampton, who were already relegated, finished bottom with 25 points although their farewell was a memorable one as they drew 4-4 at home to fifth-placed Liverpool.
EVERTON RELIEF
The celebrations at Everton were more of relief than pride as the famous old club once again found itself battling not for silverware but to avoid relegation. Last year they escaped in the penultimate game but this time it went down to the wire.
"It's a relief, this has been the hardest season of my career, so tough mentally," defender Conor Coady said.
"We had it in our hands, but we can't make this a common theme, we have to draw a line in the sand. This club has to improve because it's a giant."
Everton's relief was in marked contrast to the mood at Leicester where not even a win over West Ham, courtesy of goals by Harvey Barnes and Wout Faes, could save the Foxes.
Leicester fans lived in hope with Everton being held, but in the end they returned to the second-tier, having been promoted in 2014 and winning the title in fairytale fashion in 2016.
Dean Smith, who arrived as interim coach after FA Cup-winning manager Brendan Rodgers was sacked in April, said he had fallen a bit short in trying to save the club.
"When I came here with eight games to go I thought we probably needed 11 points. We've fallen two short of that with nine," he said. "I'm sure there will be a club review but it's disappointing. It wasn't to be."
CITY LOSE
Champions Manchester City left the majority of their first-choice players on the bench and were beaten 1-0 at Brentford, who signed off a brilliant season by completing the double over Pep Guardiola's side -- Ethan Pinnock scoring a late winner.
It was City's first defeat in 26 matches in all competitions but their eyes are fixed on next Saturday's FA Cup final against Manchester United and then the Champions League final versus Inter Milan a week later in Istanbul.
"I said to the players after the game, today we finished the Premier League that you deservedly won, enjoy two days with your families, don't see each other and on Wednesday we'll prepare the first final," Guardiola said.
Arsenal, whose title challenge collapsed under City's relentless pursuit, at least ended on a high note as the runners-up crushed visiting Wolverhampton Wanderers 5-0 with Granit Xhaka scoring twice.
Manchester United ensured they finished third with a 2-1 home win over Fulham while fourth-placed Newcastle United rounded off an impressive season with a 1-1 draw at Chelsea.
Seventh-placed Aston Villa grabbed the last European spot with a 2-1 victory against sixth-placed Brighton & Hove Albion to book a place in the Europa Conference League, leaving eighth-placed Spurs without any European football next season.