This was a setback for Arsenal in the chase to finish second in the Premier League yet reward for Swansea, City, Bafetimbi Gomis and the Goal Decision System. To the naked eye it was impossible to tell whether Gomis' late header had crossed the line but the technology did its job and Swansea were on their way to an unexpected but famous three points.
Garry Monk's well-organised side had defended well throughout, relying on the leadership of Ashley Williams. Victory was most rooted in the defiance of the former Arsenal goalkeeper, Lukasz Fabianski, lampooned as "Flappyhanski" for his occasional errors during his 78 games and seven years here.
Yet he starred for Swansea, making great saves particularly from Santi Cazorla, Theo Walcott and Nacho Monreal. As Arsenal laid siege late on, Fabianski kept picking off crosses. At the final whistle, Jonjo Shelvey and Williams led the players to congratulate their keeper.
Arsenal players looked stunned. Monreal pulled his shirt over his head as if not wanting to be associated with the defeat. Laurent Koscielny sat on his haunches on the halfway line, seemingly in disbelief.
This was an ill-timed blow for Arsenal, who face Manchester United at the weekend and will be keen to avoid fourth place and the perils of pre-qualifying for the Champions League. Arsenal lacked sufficient pace in their attacking and Olivier Giroud was a blunt instrument eventually removed.
Swansea have now done the double over Arsenal and departed to an ovation from quite a few home fans who stayed on to applaud them off, reserving a particular salute for Fabianski. The late drama was such a contrast to earlier events.
"And now, on the big screens - the best of the first half,'' the Arsenal announcer had shouted rather breathlessly and optimistically at the interval. There was little to see. Despite the prompting of Cazorla, Mesut Ozil and Alexis Sanchez, Arsenal rarely threatened Fabianski's goal before the break.
The tone had quickly been set, namely one of Arsenal possession, predominantly central, and Swansea's occasionally pacey counter-attacking down the flanks through Jefferson Montero and Nathan Dyer. The game initially exuded a slightly desultory feel, even if there was still much to play for in terms of Europe. Swansea had been targeting a Europa League place while Arsenal had wanted to ensure either second or third to avoid per-qualifying.
The Emirates was far from full, although the 3,000 Swansea fans were in good voice. There had been little to occupy their attentions in the opening half. Giroud headed a decent cross from Aaron Ramsey over. Shelvey dribbled across the Arsenal area, searching for a glimmer of David Ospina's goal, but his eventual shot was blocked.
Swansea were defending deep, swamping midfield and operating with Gylfi Sigurdsson as an unlikely, if hard-working centre-forward. Gomis and Marvin Emnes had begun on the bench. Arsenal were faced with a wall of white shirts. Shelvey took his tackling duties to excess, fouling Sanchez and going into Kevin Friend's book under the totting-up process.
On it went, the first-half exercise in lethargy and poor finishing. Ramsey clipped the ball with the outside of his boot but it faded wide. Cazorla had a shot charged down by Williams. Giroud manoeuvred some space around Williams but curled his left-footed shot wide.
Swansea were defending well. Neil Taylor nicked the ball off Ozil, then Montero also dispossessed the German. Sanchez then conjured up Arsenal's best move of the half, collecting the ball deep in his own half, looking up and lifting a 50-yard pass over Swansea's back-line for Ramsey to chase. Fabianski had read the unfolding danger and sprinted out to grasp the ball.
The second half had to be better. Both sides immediately lifted the tempo. Hector Bellerin put in a low, hard cross from the right which the sliding Federico Fernandez cleared before Giroud could get a touch. Arsenal were really quickening their attacks, looking to break before Swansea could regain their shape. Sanchez hit the side-netting. Ozil then released Ramsey but the angle tightened and he buried the ball in the side-netting.
Ospina then impressed with a low interception of a driven cross from Shelvey. Three changes were then made. Angel Rangel hobbled off, replaced by Ashley Richards at right-back for Swansea. Then the Emirates was treated to the welcome sight of Jack Wilshere coming on. He had emerged from the bench at Hull City last week and made his second appearance on his return from that ankle injury suffered in a reckless challenge from Manchester United's Paddy McNair here on Nov 22.
Wilshere was soon joined by another England international, Theo Walcott, a bonus for Ray Lewington, Roy Hodgson's England assistant in the stand. Giroud retreated to the bench as Walcott went through the middle. The pressure on Fabianski's goal intensified. Cazorla unleashed a shot that deflected wide off Williams. Bellerin then teased in another ball from the right but Walcott's shot failed to trouble Fabianski.
Fabianski continued to defy his old team-mates. He repelled a shot from Sanchez and Walcott's follow-up, and moments later from Cazorla. It was an astonishing display of shot-stopping from a keeper once derided for some of his mistakes during his time at Arsenal.
Garry Monk had made some attacking changes, removing the excellent Ki Sung-Yeung for Gomis, withdrawing Sigurdsson into midfield. Modou Barrow replaced Dyer on the right. But the force remained with Arsenal, who were hammering at Swansea's back door.
With five minutes remaining, Swansea turned the game on its head. Barrow flew down the right, lifting in a cross that Bellerin leapt towards and flicked away but only on to Montero. The winger turned the ball back in, and Gomis was the most determined, reaching the cross, heading it goalwards.
Ospina dived to his left, pushing the ball away but Swansea screamed that it had crossed the line. Friend got the signal that it had crossed the line, blew his whistle and pointed to the halfway line. There was still some pressure to withstand but with Fabianski in goal, Swansea were safe.