Andre Ayew scored a winner deep into injury time as Swansea closed in on the automatic promotion spots with a 2-1 victory at Stoke.
The striker slotted home his 11th of the season from the penalty spot after Kyle Naughton was controversially adjudged to have been tripped by Spurs loan man Jack Clarke in the 94th minute.
The Swans' first success at the Bet365 Stadium in almost exactly 20 years has put them within a point of second after Brentford dropped points at Norwich.
Nick Powell had given the hosts an early lead with his sixth goal in nine games, but Connor Roberts levelled before the break.
Stoke hit the woodwork twice through Tommy Smith and Steven Fletcher, while Roberts almost grabbed a late clincher.
But it was Ayew who claimed the glory with almost the last kick of the game.
A shocking error from Marc Guehi gifted Stoke a sixth-minute lead when the Swans defender's pass was cut out by Fletcher and Powell thumped his shot past the helpless Freddie Woodman.
Korey Smith blazed over from an angle as the visitors tried to respond, and they got level after 19 minutes when Ryan Manning's whipped cross was expertly volleyed home by Roberts from eight yards for his fourth of the campaign.
Smith's stunning drive from range clattered off the upright with Woodman beaten just before the half-hour mark, while Stoke keeper Angus Gunn could only parry Manning's fierce effort at the other end before John Obi Mikel hacked clear.
Another effort from the impressive Manning was inches wide, Ayew's header was easy for Gunn, and Woodman clawed away a Harry Souttar snapshot, as an entertaining first half came to a close.
With 49 minutes gone, Fletcher somehow hit the post from four yards out after he got on the end of Smith's superb cross, and James Chester lashed the loose ball over when it looked easier to score.
Clarke, who came off the bench at the break and helped the hosts gain more control in a switch to 4-4-2, saw a header well blocked as the game entered the final 20 minutes.
Swans came on strong in the closing stages and Conor Hourihane's whipped cross was volleyed on target by Roberts only for Gunn to make a brilliant reaction save.
Gunn also held Hourihane's drilled free-kick after 85 minutes, but Naughton went down under slight contact from Clarke, and referee David Webb pointed to the spot. Ayew made no mistake from 12 yards, sending Gunn the wrong way.
What the managers said...
Stoke's Michael O'Neill: "It wasn't a penalty - it's a ridiculous decision. I've seen in three times and there's no contact; I think the player makes contact with himself, actually. There's a clear foul on James Chester where Andre Ayew runs into him and throws himself to the ground, the ball drops and then the piece of play leading to the alleged penalty is given. It's a really poor decision.
"It was really disappointing as I think we did more than enough to take something from the game. We certainly didn't deserve to lose. Games shouldn't be decided by things like that and it's cost us. I think it's very harsh on us."
Swansea's Steve Cooper: "You always need three points and a win. We never gave up. We had a difficult start to the game with going 1-0 down but, once again, the players got on with it and showed desire to stick to the plan. We scored an excellent goal to make it 1-1 and it was a fairly decent game from there.
"After the changes, I thought there was only one team that was going to win it through passing and getting into good areas. We've got two games extra to play and I know I keep saying about the next game and things like that, but we've got a little bit of catching up to do in terms of points to be won. We'll stick to the plan at the moment and just look after ourselves."