Match ends, Manchester United 2, Arsenal 1.
Arsene Wenger's final trip to Manchester United as Arsenal manager ended in an agonising defeat after an injury-time winner from Marouane Fellaini.
The Belgium international flicked a header past Gunners goalkeeper David Ospina from an Ashley Young cross.
Just three minutes earlier he had headed against the post, with Marcus Rashford bundling home the rebound from an offside position.
United had opened the scoring on 16 minutes when a header from former Arsenal player Alexis Sanchez was knocked on to the post by Hector Bellerin and Paul Pogba stabbed home the rebound for his third goal in four league games.
The hosts lost striker Romelu Lukaku to injury early in the second half, and moments later Henrikh Mkhitaryan was left in plenty of space to weave and strike through the legs of Victor Lindelof.
The game's tempo petered out after the equaliser - until Fellaini - who Jose Mourinho says is close to a new contract - popped up to snatch the win for United, and secure Champions League football for next season.
The best of frenemies
Wenger had joked before Sunday's match that he "always got a great reception at Old Trafford" - referring to his long-standing rivalry with United.
On this occasion, it was true. Old foe Sir Alex Ferguson was master of ceremonies in a pre-match presentation for the Frenchman, who will leave Arsenal at the end of the season after 22 years as manager.
The crowd applauded as Wenger was given a silver vase by former United boss Ferguson, and the pair embraced during a photo opportunity in which they were briefly joined by current Red Devils manager Mourinho.
"It was very nice and classy. I enjoyed it," Wenger said after the game. "I have come here for a long, long time. Next year, someone else will be in the dug-out and it will be a hostile environment again."
The atmosphere did change after Pogba's opener, with the home crowd chanting 'we want you to stay' and the Arsenal fans responding: 'Arsene Wenger, he won the league here.'
Wenger - whose team won the title at Old Trafford in 2002 - started the game smiling, but left disappointed after his side stretched their winless run here to 11 matches.
The Frenchman admitted he was unsure whether he would meet Mourinho again, saying: "He will be at Man Utd next year certainly and I don't know where I will be.
"I have worked at a top level for 35 years without any interruption and I think I am the only one who has done that. I am in unknown territory.
"Will I take a break? I will be surprised if I meet him next year."
When asked about his gift, Wenger revealed: "I don't know [what it is]. I haven't looked at it. I want to have a glass of red wine with Sir Alex because it is always good wine. Once you are not a danger any more, people love you."
Arsenal's winless away run goes on
Wenger opted to make eight changes to his team, with one eye on Thursday's Europa League semi-final second leg at Atletico Madrid, which is poised at 1-1.
With an average age of 24 years and 67 days, it was Arsenal's youngest starting XI in the Premier League since August 2011 - in their infamous 8-2 defeat at Old Trafford.
It was a different story this time around. The Gunners made few mistakes and looked lively in parts, with Ainsley Maitland-Niles and Danny Welbeck testing United keeper David de Gea.
Mkhitaryan produced a cool and accurate finish for his goal, before being taken off with a knee injury which will be assessed before Thursday.
But three defenders failed to deal with a rising Fellani in the box as he headed home a winning goal that meant Arsenal remain the only team in England's top five tiers without an away win in 2018.
"The players are destroyed because they gave everything and were caught in the final minute," said the Gunners boss.
"There were many question marks if we would be strong enough to fight but the quality was good the spirit was good, many players stood up. It was a negative result and a positive performance."
'We want second'
United's final chance for silverware this season comes on 19 May, when they face Chelsea in the FA Cup final.
Victory over Arsenal means they will definitely finish in the top four in the league, but Mourinho is adamant they are aiming for second behind champions Manchester City.
"We won three points and that kills the Champions League story," he said after the game.
"But we still need four points to finish second which is what we want."
United now have a five-point advantage over third-placed Liverpool with a game in hand.
Wenger's Old Trafford hoodoo - the stats from Man Utd's win
- Other than at Emirates Stadium and Highbury, Wenger has lost more matches at Old Trafford as Arsenal manager than at any other ground.
- United completed a Premier League double over the Gunners for the first time since the 2011-12 campaign.
- Fellaini's goal was the first 90th-minute winner United have scored against Arsenal in the Premier League, and the first in this fixture since January 2007, when Thierry Henry scored one at the Emirates in the home side's 2-1 win.
- United have won all 10 of the Premier League games in which Pogba has found the net.
Man of the match - Ashley Young
Manchester United visit Brighton in the Premier League on Friday (20:00 BST). Arsenal travel to Spain for their Europa League tie with Atletico Madrid on Thursday (20:05 BST) before returning to league action against Burnley on Sunday (16:30 BST).
- 1De Gea
- 25A Valencia
- 21HerreraSubstituted forMartialat 64'minutes
- 14LingardSubstituted forFellainiat 64'minutes
- 9LukakuSubstituted forRashfordat 50'minutes
- 40Castro Pereira
- 31KolasinacSubstituted forMonrealat 64'minutes
- 29XhakaBooked at 24mins
- 7MkhitaryanSubstituted forWillockat 76'minutes
- 61NelsonSubstituted forWelbeckat 64'minutes
- Kevin Friend
- Shots on Target
Second Half ends, Manchester United 2, Arsenal 1.
Corner, Manchester United. Conceded by Ainsley Maitland-Niles.
Goal! Manchester United 2, Arsenal 1. Marouane Fellaini (Manchester United) header from the centre of the box to the bottom right corner. Assisted by Ashley Young with a cross.
Corner, Manchester United. Conceded by Héctor Bellerín.
Offside, Manchester United. Marouane Fellaini tries a through ball, but Marcus Rashford is caught offside.
Marouane Fellaini (Manchester United) hits the right post with a header from the centre of the box. Assisted by Anthony Martial with a cross.
Foul by Marouane Fellaini (Manchester United).
Alex Iwobi (Arsenal) wins a free kick in the attacking half.
Paul Pogba (Manchester United) wins a free kick in the attacking half.
Foul by Granit Xhaka (Arsenal).
Foul by Antonio Valencia (Manchester United).
Danny Welbeck (Arsenal) wins a free kick in the defensive half.
Foul by Marouane Fellaini (Manchester United).
Granit Xhaka (Arsenal) wins a free kick in the defensive half.
Attempt missed. Antonio Valencia (Manchester United) right footed shot from the right side of the box is too high. Assisted by Ashley Young with a cross.
Attempt missed. Anthony Martial (Manchester United) right footed shot from outside the box misses to the right. Assisted by Alexis Sánchez following a corner.
Corner, Manchester United. Conceded by Joe Willock.
Corner, Manchester United. Conceded by David Ospina.
Corner, Manchester United. Conceded by Alex Iwobi.