Maouane Fellaini scored a stoppage time winner as Manchester United claimed all three points to mathematically secure a top-four finish in Jose Mourinho and Arsene Wenger's last ever showdown.
Despite the animosity towards Wenger down the years at Old Trafford, the Frenchman was greeted by warm applause as he walked up the Old Trafford touchline for the final time. Wenger's old foe Sir Alex Ferguson was present to meet the Arsenal manager before kick-off, in a place were both men have gone head-to-head many times down the years.
But with Ferguson returning to the stands, the final match-up between Mourinho and Wenger got underway, and the game got off to a flying start, with Paul Pogba missing a golden opportunity yards from goal inside five minutes.
As the home side began to control the opening 10 minutes, Arsenal became boxed into their own half, with Pogba, Nemanja Matic and Ander Herrera controlling the midfield, and Jesse Lingard providing threatening creativity from the wings.
The chances continued to mount for Mourinho's men and Arsenal struggled to cope with the fluid passing from the United midfield.
It was not long until the home side achieved their breakthrough, as Romelu Lukaku delivered an inch-perfect cross to ex-Arsenal star Alexis Sanchez, only to have his header blocked off the line by Hector Bellerin. However, Bellerin's last-ditch block only fell to Pogba, who tapped in his sixth Premier League goal to give his side an early lead.
Shortly after the Frenchmen's goal, Arsenal gradually started to find their feet. Ex-United player Henrikh Mkhitaryan came within inches of equalising, as his shot beat De Gea but beat the post as well.
As time went on in the first-half, Ainsley Maitland-Niles and Mkhitaryan started to influence the Arsenal attack, and the away side began to see much of the ball inside the final-third. Pierre-Emerick Aubameyang had the best chance for the Gunners, but his tame header was simple work for De Gea.
Arsenal could not make their late flurry of chances count, and the sides went in at the break with United leading, but with Arsenal looking threatening.
The Gunners continued from where they left off, by troubling the United defence, with Mkhitaryan finding pockets of space close to De Gea's goal.
Within minutes of the second-half, Lukaku picked up an injury, and the Belgium was forced to depart the pitch on his 50th United appearance, with Marcus Rashford coming on as his replacement.
The home side struggled to make an impact in the early stages of the second-half, and Arsenal finally made United pay for their poor defensive work, as Mkhitaryan came back to haunt his old side three months after being forced away from Old Trafford, as he neatly placed the ball past De Gea from outside the box to make it 1-1.
The atmosphere at Old Trafford became increasingly subdued as the half went on, as neither side could create a clear-cut chance since the equaliser from the former United employee.
With just 30 minutes remaining in Wenger's final Old Trafford showdown, the Frenchman brought on ex-United man Danny Welbeck, whilst Fellaini entered the fray for Mourinho's side
With the result on the line, United became the more likely side to claim three points in the final 15 minutes, as the home side began to control possession, with substitute Anthony Martial causing trouble for Bellerin and Calum Chambers.
As the game approached its climax, Fellaini had the best chance of the second-half to put his side in front, but his tall frame was not enough to poach the header from a wonderful Ashley Young cross.
It was the Belgium once again with a golden opportunity, but his smashing header hit the post, only for the rebound to be tapped in by Rashford. The Old Trafford faithful thought their side had taken the lead, but the goal was rightly disallowed for offside.
However Fellaini finally took his chance late on, towering above the Arsenal defence to smartly head the ball past David Ospina and give United a 2-1 lead in injury time.
The goal meant that Wenger's last match at Old Trafford ended in defeat, despite his side's positive attitude and creativity up top.
The victory for United puts them five points clear of Liverpool in third, whilst Arsenal remain pointless away from home in 2018 with six away losses on the bounce for Wenger in his final season at the club, leaving Arsenal now mathematically unable to reach the top four.