Match ends, Huddersfield Town 0, Arsenal 1.
Arsene Wenger said he was "sad" and would find it difficult to adjust to life without Arsenal as his 1,235-game reign as manager came to an end with a victory over Huddersfield on the final day of the Premier League season.
The game had little riding on it, with Huddersfield having already avoided relegation and Arsenal finishing sixth no matter what, and was played in a carnival atmosphere at John Smith's Stadium.
Wenger emerged for kick-off to a rapturous reception and went over to applaud the Arsenal fans, taking a bow.
Both sets of fans gave him a standing ovation after 22 minutes - to celebrate his 22 years in English football - and two planes flew over the ground in the early stages with banners celebrating the Frenchman.
Wenger brought three Premier League titles and seven FA Cups, including two Doubles, to Arsenal - but leaves them in the lowest position since he arrived, sixth.
"Of course it is very emotional after 1,235 games for the same club," said the 68-year-old. "To enjoy it we had to win it. Winning football games is what makes me happy and the boys did it.
"Do I feel relief? Not really, I'm sad. At some stage it has to end. I wish everyone well, the fans have been great until the end and I wish the club well for the future.
"It will be hard to adjust but I will have to deal with that. I will remain an Arsenal fan above everything else.
"I will stay in football for sure. Whether that is managing or not... I am addicted and I don't think that can be cured."
This win over Huddersfield was the first time in eight attempts Arsenal have picked up any points away from home in the Premier League in 2018 - making them the last professional team in England to do so.
Their goal was scored by Wenger's final signing - Pierre-Emerick Aubameyang - as he slid home a low cross from their longest-serving player, Aaron Ramsey.
Terriers midfielder Aaron Mooy almost denied Wenger his farewell win late on as his shot crashed off the crossbar.
"Twenty two years as a manager at one football club is incredible," said Town boss David Wagner. "Even if you speak about it you can't believe it.
"I've been here for two and a half years and already it feels like 22 years. It was an honour for us to host his last game as Arsenal manager because he is a legend - a living legend."
- Man City were behind in games for just 153 minutes this season - final-day stats round-up
- Sir Patrick Stewart on Huddersfield's 'wonderful' season
- The Premier League table - from August to May
Arsenal grind out final-day win
Wenger had hoped Wednesday's Europa League final would be his farewell game but Atletico Madrid scuppered those hopes in the semi-final, ensuring the Frenchman will not leave the club with Champions League football next season.
In truth, they have been poor for much of this campaign, with fans turning on Wenger before his departure was announced in April - enabling him to say goodbye in more pleasant circumstances.
The Gunners' sixth-placed finish is their worst under Wenger, and seven consecutive away Premier League defeats before this game tell their own story.
They were slightly fortunate to send Wenger off with a victory, with the only goal coming when Alexandre Lacazette passed the ball wide to Ramsey, who delivered an excellent low cross which Aubameyang turned home.
The Gunners only had four shots on target, with Lacazette chipping into Jonas Lossl's hands and Danny Welbeck firing straight at the goalkeeper in the second half.
Now Arsenal have to find a replacement for Wenger and when the 2018-19 season starts, there will be a manager other than the Frenchman in the dugout for the first time since 1996.
"It will be strange not seeing him around in pre-season but change happens," said Ramsey. "I am sure whoever comes in, this club is in a fantastic place for them to put their stamp on it. Arsene has created a fantastic team here that is capable of going on with a few tweaks."
Wenger said: "I see a bright future for my successor because the team has a good attitude and quality. The team needs some additions and if they get them I think they will compete for the Premier League title."
Huddersfield unlucky to lose - but they don't really care
Terriers fans invaded the pitch at the final whistle, keen not to allow this defeat to overshadow a fantastic season in which their side have defied expectations to survive in the top flight.
They had ensured their safety with surprise draws at Manchester City and Chelsea in their previous two games - meaning their return to the top flight for the first time since 1972 would not be a one-year stay.
Wagner's side had chances throughout the game - although their two huge opportunities to spoil Wenger's farewell came late on.
First Mooy smacked a shot off the crossbar, then Laurent Depoitre's header was saved by David Ospina on the line with seconds left after keeper Lossl had ventured forward for a corner.
On a day to celebrate, and with the clock winding down, the Terriers brought on retiring midfielder Dean Whitehead with three minutes left. He now joins the club's coaching staff.
'The best lap of honour I've ever had'
Huddersfield manager David Wagner: "I think these players, the backroom staff and all the families deserve it for what they have done this season. They have worked very hard from day one.
"We're happy our supporters have something to celebrate. It is the best lap of honour I've ever had.
"I think staying up is a huge step for the football club. It was a massive step to get promoted last season and to keep our status is even bigger. To finish 16th is huge, an incredible achievement for this football club."
'Arteta the right man to replace Wenger'
BBC Match of the Day pundit Ian Wright
Right from the start when he came in Arsene was all about efficiency. It was about what you ate, how you prepared. He wanted me to be more efficient. He really was a breath of fresh air.
I like the feel of Mikel Arteta to replace him. He knows the club and you've got to take a chance on someone. They took a chance on Wenger.
Some of those players need a kick up the backsides and maybe Arteta is the man to do it.
Man of the match - Arsene Wenger
Match stats - Gunners' unusual Sanchez stat comes to an end
- The John Smith's Stadium was the 48th different ground Wenger has won at in the Premier League - more than any other manager in the competition (Sir Alex Ferguson 47).
- Huddersfield have failed to score in 21 different Premier League games this season - only Derby (22 in 2007-08) have ever failed in more in a single campaign.
- This was the first away game Arsenal won in the Premier League in which Alexis Sanchez did not score since October 2016.
- It was also the first time Arsenal kept a Premier League clean sheet on the road since December, having conceded in each of their last nine.
- 1-0 was Wenger's third most common scoreline in Arsenal games in all competitions (124), after 1-1 and 2-1 (127 each).
- Aubameyang has been directly involved in 14 goals in just 13 Premier League games (10 goals, 4 assists). Only Alan Shearer (16), Mick Quinn (16) and Kevin Phillips were involved in more in their first 13 in the competition.
- 25M JorgensenBooked at 90mins
- 6HoggSubstituted forWhiteheadat 87'minutes
- 22InceSubstituted forDepoitreat 61'minutes
- 24MounieSubstituted forBillingat 79'minutes
- 31KolasinacSubstituted forMonrealat 68'minutes
- 17IwobiSubstituted forMaitland-Nilesat 72'minutes
- 14AubameyangSubstituted forWelbeckat 67'minutes
- Michael Oliver
- Shots on Target
Second Half ends, Huddersfield Town 0, Arsenal 1.
Zanka (Huddersfield Town) is shown the yellow card for a bad foul.
David Ospina (Arsenal) wins a free kick in the defensive half.
Foul by Zanka (Huddersfield Town).
Attempt saved. Laurent Depoitre (Huddersfield Town) header from the centre of the box is saved in the bottom left corner. Assisted by Aaron Mooy with a cross.
Foul by Ainsley Maitland-Niles (Arsenal).
Chris Löwe (Huddersfield Town) wins a free kick on the left wing.
Ainsley Maitland-Niles (Arsenal) wins a free kick in the attacking half.
Foul by Philip Billing (Huddersfield Town).
Attempt missed. Philip Billing (Huddersfield Town) right footed shot from outside the box is high and wide to the right. Assisted by Laurent Depoitre with a headed pass.
Aaron Mooy (Huddersfield Town) hits the bar with a right footed shot from the right side of the box. Assisted by Florent Hadergjonaj.
Substitution, Huddersfield Town. Dean Whitehead replaces Jonathan Hogg.
Attempt blocked. Jonathan Hogg (Huddersfield Town) right footed shot from outside the box is blocked. Assisted by Laurent Depoitre.
Offside, Arsenal. Henrikh Mkhitaryan tries a through ball, but Alexandre Lacazette is caught offside.
Attempt missed. Granit Xhaka (Arsenal) left footed shot from outside the box misses to the right.
Attempt saved. Danny Welbeck (Arsenal) left footed shot from the left side of the box is saved in the bottom right corner.
Attempt saved. Alexandre Lacazette (Arsenal) right footed shot from the right side of the box is saved in the centre of the goal. Assisted by Henrikh Mkhitaryan.
Danny Welbeck (Arsenal) wins a free kick in the defensive half.
Foul by Philip Billing (Huddersfield Town).