Alfie Devine scored his first senior double as Preston beat Stoke City at Deepdale to end their seven-game winless Championship run.
Devine, 21, ran from inside his own half to cancel out Sorba Thomas' opener before he claimed Preston's third goal with a chipped finish.
The on-loan Tottenham midfielder, who had a temporary spell at Stoke's rivals Port Vale in 2023-24, netted just two and a half minutes after Milutin Osmajic scored to give Preston the lead.
Paul Heckingbottom's Preston have leapfrogged Stoke into the top half of the table and Mark Robins' side have won just two of their past 13 league games.
Preston fans were fearing a repeat of last season's collapse in the run-in when they won just one of their final 15 games to stay up on the last day.
This massive victory, just their second in 13 league games, will settle nerves and Lewis Dobbin stood out with Devine.
Preston, who were missing the suspended Jordan Thompson, began brightly, but it was Stoke who took the lead after just four minutes thanks to a moment of magic from Thomas for his 10th goal of his fine season.
Preston gave the ball away and Junior Tchamadeu burst forward down the right before crossing to the back post for Thomas to volley home and the Wales winger held up his black armband in tribute to eight-year-old Potters fan Ollie Royles who died this week following a cancer battle.
Stoke's lead lasted just 11 minutes and Andrew Moran found Devine, as he raced through from his own half, and he applied a clinical left-footed finish into the far corner.
The game was feisty and Preston skipper Ben Whiteman was extremely lucky to escape with just a yellow card when he caught Thomas high and late.
Preston went up through the gears and took the lead when Dobbin crossed from the right to the near post, where the unmarked Osmajic headed home his eighth club goal of the season from four yards out.
Stoke faded in the second half and Preston scored a third on the hour when Osmajic turned creator to feed Devine and he coolly chipped Stoke goalkeeper Tommy Simkin for his eighth of the campaign.
Preston manager Paul Heckingbottom told BBC Radio Lancashire:
"Listen, I've been saying it's about the wins. No one is interested in what you say when you're not winning, you know it's about the win.
"We have played well in previous games and not got over the line and today we started really well again, and then their first pass, their first cross, they score.
"We had that against Norwich, where we started the better team, made a mistake and they go one up. Kenny McLean puts one in the top corner from a free-kick.
"We were the dominant team, but we couldn't get the goal, couldn't get the points. Today we did, so that will make everyone feel better, definitely.
"The performance was excellent from start to finish and we turned the game round from that difficult start, and it wasn't just me thinking 'here we go again', so it's great."
Stoke boss Mark Robins told BBC Radio Stoke:
"We let the supporters down and we had 3,000 supporters here tonight - we've really let them down. That's miles away from where I expect the performance to be.
"We didn't start particularly well, you know, inexplicable. We certainly didn't win enough duels in the first half. But we got the first breakaway and we score from it, and they're on the back foot.
"They've been on the back foot for some weeks now and they looked like that. They were there for the taking and whatever happened in this game, the pitch, whatever, I have no clue.
"There were too many players with off days and I think we've let everybody down. We've not competed well enough in the game and that's inexplicable to me.
"It's just unacceptable. That isn't a performance that's associated with our team."