Match ends, Crystal Palace 2, Stoke City 1.
Crystal Palace secured their top-flight status by coming back from a goal down to beat Stoke City at Selhurst Park.
The Potters took the lead with a well-worked move which ended with Marko Arnautovic setting up Charlie Adam to angle in a shot.
Dwight Gayle equalised for the home side when he side-footed in after Yannick Bolasie's mazy run.
And the Eagles striker got the winner when he picked himself up from a foul to score with a 25-yard free-kick.
Relive Crystal Palace's win over Stoke
Follow reaction to Saturday's Premier League games
Gayle puts forward FA Cup claim
Palace can now look forward to their FA Cup final against Manchester United on 21 May without any lingering worries about relegation, while Gayle's performance will have given boss Alan Pardew a selection dilemma for the Wembley showpiece.
Gayle was playing as winger Wilfried Zaha was out with a leg injury, and he took his opportunity to impress as Palace won for only the second time in their past 20 league games.
He had two penalty claims turned down in the first half but his persistence paid off as he coolly scored his first goal after the ball broke to him following Bolasie's run.
His second came despite him appearing to slip as he took the free-kick.
"It's the most important thing, staying in the Premier League," said Gayle.
"It hasn't been the best few months but, hopefully, in the next few weeks we can turn [the season] around.
"The most important thing for me is to enjoy my football which I am at the moment and hopefully I can be in and around the team for the FA Cup final."
However, there was concern for Pardew with midfielder Yohan Cabaye and his replacement Joe Ledley both having to go off injured.
Stoke's season fizzling out
When Stoke scored the opener from a move involving Giannelli Imbula and Arnautovic before Adam applied the finishing touch, it seemed they were determined to end a run of five games without a win.
They put in the kind of effort which made a mockery of claims that, because the Potters had no chance of a European place or were in any danger of relegation, they were already on the beach.
However, they struggled to maintain their performance in the second half and were punished by Gayle.
Arnautovic sent a late shot over when well-placed to level and the defeat now means Stoke cannot match their best points tally of 54 in the Premier League.
Man of the match - Dwight Gayle
Crystal Palace boss Alan Pardew: "The first half was not our best. It's difficult as we have got one eye on the FA Cup final.
"We needed to make sure we got a win for home fans and second half we were great and had numerous chances.
"I said to him [Dwight Gayle] at half-time that I thought he was our best player. He wanted to show me and he couldn't have done anymore. We've lacked a goalscorer this season. He is a force for us."
Stoke manager Mark Hughes: "Today wasn't quite what we were looking for - a low-quality game in my opinion. It's not the way we anticipated finishing off the season.
"There was no question of our effort today. Just a bit of frustration that we didn't play as well as we are capable of."
The stats you need to know
- Since his debut in August 2013, Gayle has scored more Premier League goals for Palace than any other player (15).
- The Eagles won just their second Premier League game in 2016, having drawn five and lost 11 of 18 games.
- Charlie Adam scored his first goal of the season and his first since scoring against Liverpool on the final day of last season.
- Marko Arnautovic has had a hand in 17 goals for Stoke in the Premier League this season (11 goals, six assists), eight more than any other player.
- The Potters have kept just one clean sheet in their last 15 Premier League games.
- Stoke are now winless in six Premier League games (D2 L4), their worst run since September 2015.
Crystal Palace end their league campaign with a game at manager Alan Pardew's former club Southampton on the final day of the season next Sunday, while Stoke finish off at home against West Ham.
- 23SouaréBooked at 90mins
- 18McArthurBooked at 33mins
- 7CabayeSubstituted forLedleyat 45'minutesSubstituted forMutchat 56'minutes
- 16GayleSubstituted forSakoat 90+2'minutes
- 3PietersBooked at 21mins
- 6WhelanBooked at 3minsSubstituted forBojanat 75'minutes
- 22ShaqiriSubstituted forWaltersat 65'minutes
- 16AdamSubstituted forIrelandat 65'minutesBooked at 87mins
- Kevin Friend
- Shots on Target
Second Half ends, Crystal Palace 2, Stoke City 1.
Pape Souaré (Crystal Palace) wins a free kick in the defensive half.
Foul by Marko Arnautovic (Stoke City).
Substitution, Crystal Palace. Bakary Sako replaces Dwight Gayle.
Pape Souaré (Crystal Palace) is shown the yellow card.
Yannick Bolasie (Crystal Palace) wins a free kick on the left wing.
Foul by Phil Bardsley (Stoke City).
Attempt missed. Jordon Mutch (Crystal Palace) right footed shot from outside the box is high and wide to the right following a set piece situation.
Stephen Ireland (Stoke City) is shown the yellow card for a bad foul.
Yannick Bolasie (Crystal Palace) wins a free kick on the right wing.
Foul by Stephen Ireland (Stoke City).
Attempt missed. Marko Arnautovic (Stoke City) right footed shot from the centre of the box is just a bit too high. Assisted by Stephen Ireland with a through ball.
Attempt missed. Jonathan Walters (Stoke City) right footed shot from the right side of the box misses to the left. Assisted by Peter Crouch with a headed pass.
Offside, Crystal Palace. Damien Delaney tries a through ball, but Yannick Bolasie is caught offside.
Offside, Stoke City. Erik Pieters tries a through ball, but Jonathan Walters is caught offside.
Foul by Scott Dann (Crystal Palace).
Giannelli Imbula (Stoke City) wins a free kick in the defensive half.
Corner, Crystal Palace. Conceded by Ryan Shawcross.
Connor Wickham (Crystal Palace) wins a free kick on the right wing.