Arsenal, plagued by defensive selection issues, claimed a third FA Cup win in four seasons and 13th in total, making them the outright most successful team in the competition’s history ahead of Manchester United.
Antonio Conte’s Chelsea, who had Victor Moses sent off after he received a second booking for diving, were thwarted in their attempt to complete a Premier League and FA Cup Double for the second time.
It meant no glorious farewell for departing skipper John Terry, who will bow out on 717 appearances and 17 major honours after spending the match on the bench.
Victory was rich vindication for Wenger, whose Arsenal future is due to be decided by a board meeting in the coming days, and allowed him to salvage something from the most difficult season of his 21-year tenure.
He is reported to have been offered a two-year contract and while dissent against him has mounted this season, the stirring nature of his side’s win will surely have won back some of his team’s disgruntled fans.
The Frenchman’s team took a fourth-minute lead with a goal that will be debated long after the final whistle.
After blocking N’Golo Kante’s attempted clearance on the edge of Chelsea’s box, Sanchez ran through to skewer a shot past Thibaut Courtois, only for an offside flag to be raised against Ramsey.
– Mertesacker magnificent –
Referee Anthony Taylor consulted his assistant referee before concluding, correctly, that Ramsey had not been interfering with play, but replays showed Sanchez had handled the ball when he charged down Kante’s clearance.
Arsenal’s play brimmed with belief, Mesut Ozil forcing Gary Cahill to clear off his own line and Danny Welbeck and Ramsey hitting the same post in quick succession from a corner.
The absences of the suspended Laurent Koscielny, the injured Gabriel and the concussed Shkodran Mustafi brought club captain Per Mertesacker into Arsenal back three for his first start of the season.
But there were few signs of ring-rust as the former Germany defender produced three crucial last-ditch blocks to thwart Costa.
Chelsea stepped things up in the second half, with Arsenal goalkeeper David Ospina foiling Kante and Moses and Pedro curling narrowly wide, before Cesc Fabregas entered the fray in place of Nemanja Matic.
But Arsenal continued to threaten on the break, Hector Bellerin working Courtois with a firm, low shot, and in the 68th minute the momentum tilted yet further in their direction.
Already booked for holding back Welbeck on the touchline, Moses was shown a second yellow card for hurling himself to the ground in the Arsenal box in anticipation of an Alex Oxlade-Chamberlain challenge that never came.
Despite going a man down, Chelsea contrived to equalise in the 76th minute when Costa chested down substitute Willian’s pass before beating Ospina with the aid of a slight deflection off Mertesacker.
But Wenger reacted by sending on Olivier Giroud and within a minute of coming on for Welbeck, he crossed from the byline on the left and Ramsey charged in to net the winner with a stooping header.
Bellerin shot just wide and Ozil hit the post after cutting inside Cesar Azpilicueta, but just as in the 2014 final against Hull City, Ramsey’s goal was to prove the winner.