Substitute Charlie Austin headed a late winner as Southampton beat Arsenal 3-2 to give Ralph Hasenhuttl a memorable victory in his first home game in charge.
Two goals from Henrikh Mkhitaryan had twice brought Arsenal back from a goal down, Danny Ings striking twice for the Saints, before Austin had the final say to move the home side out of the relegation zone and end the Gunners' 22-game unbeaten run.
Southampton made a purposeful start, Nathan Redmond running at the Arsenal defence, but it was the Gunners who engineered the first chance with five minutes on the clock.
It came when Matteo Guendouzi's long pass found Pierre-Emereick Aubameyang racing into the area, but Saints keeper Alex McCarthy raced off his line to divert the shot behind for a corner.
Back came Southampton, Redmond again involved before Matt Targett's cross was cleared, and the home side had a scare when Redmond pulled up after a challenge with Granit Xhaka.
But the attacker was able to continue and, after rejoining the action, saw a shot deflected wide after another direct run.
More excellent work from Redmond enabled Stuart Armstrong to fire a shot from the edge of the box, Bernd Leno saving, as Southampton continued to have the better of things.
And they took a deserved lead after 20 minutes, Ings in the right place to head home an outstanding cross from the left by Targett.
But out of almost nothing, Arsenal levelled eight minutes later with a fine goal, Nacho Monreal crossing for Mkhitaryan to head past McCarthy, and they almost took the lead moments later when the ball was scrambled away from Aubameyang in the six-yard box.
Saints defender Jannik Vestergaard headed over from another Targett delivery with the home side looking to reassert their authority, and with just under five minutes remaining until half-time Redmond had a shot blocked after a short corner.
But a minute before the break, Hasenhuttl's team were back in the lead in style, Ings floating a superb header over Leno from Redmond's cross.
Arsenal boss Unai Emery made a half-time change, bringing on striker Alexandre Lacazette for defender Hector Bellerin, and it almost paid instant dividends as Aubameyang was denied by McCarthy after Mkhitaryan's pass.
Southampton's Jan Bednarek was booked for a foul on Lacazette and soon afterwards Arsenal levelled again when Mkhitaryan's strike from the edge of the area was deflected in after the home side lost the ball deep inside their own half.
The goal left Hasenhuttl looking to the skies in disbelief, and things nearly got worse for the Saints boss when Alex Iwobi curled over after Aubameyang had set him up.
As the hour approached, Targett tried to get Southampton back on the attack but his low cross was cleared by Lucas Torreira, and they had another chance when Laurent Koscielny fouled Redmond and was booked, only for the free kick to come to nothing.
Southampton took Redmond -- who had required treatment after the Koscielny challenge -- off, Shane Long replacing him, but he was unable to get into the game as Arsenal pressed, Iwobi's low cross claimed under pressure by McCarthy.
Iwobi made way for Mesut Ozil as Emery made another change, Southampton following with one of their own as two-goal Ings made way for Austin.
Ainsley Naitland-Miles came on for Stephan Lichtsteiner as Arsenal made their final change before Southampton thought they had regained the lead with a quarter of an hour remaining, Long denied by the offside flag after scrambling home from close range.
But Long was not to be denied a pivotal role in the game and, with five minutes remaining, his deep cross from the right was misjudged by Leno and headed in by Austin for a dramatic winner.