West Ham's dreams of a first major trophy since 1980 are still alive as they came from behind to secure a narrow Europa Conference League semi-final first-leg win over Dutch side AZ Alkmaar at London Stadium.
The Hammers' hopes of reaching the final in Prague on 7 June were hanging by a thread when Alphonse Areola made a mess of saving Tijjani Reijnders' low shot four minutes before the break.
But in front of jubilant home support, David Moyes' side turned the tie on its head after half-time.
They had former Brighton goalkeeper Mat Ryan to thank for offering them a way back into the contest when he recklessly punched Jarrod Bowen in the face as he arrived late to challenge for a high ball the England man actually headed over.
After Ryan took an age to take his position for the penalty, Said Benrahma beat him with a powerful shot into the corner.
And 15 minutes from time Michail Antonio hit the winner from close range, stabbing home the loose ball after Nayef Aguerd's initial header had been blocked by Yukinari Sugawara on the line.
West Ham will take nothing for granted given AZ were two down after the first leg of their quarter-final with Anderlecht and still made it through.
However, the hosts did carry the greater threat and would have taken a firmer grip on the tie had Benrahma found the target rather than blazing over after being set up by Danny Ings.
"We've got a narrow lead but nothing more than that," said Moyes.
"The tie is very evenly balanced, there is very little in the game, if we were losing by a goal I wouldn't be saying we were out of the tie.
"I'm pleased we've got ourselves in front, which is a big thing. It was a difficult night.
"I hugely believe we've got a big resilience here, through the club, through the team, and we've needed it.
"We have a big job to do next week."
Benrahma shines for resurgent Hammers
Benrahma has frustrated Moyes at times this season.
Signed from Brentford in 2020 in a deal that could rise to £30m, Benrahma has never quite hit the heights many feel he is capable of on a consistent basis.
Moyes has pushed the Algerian to improve his end product, believing that holds the key to unlocking a true attacking menace.
And at London Stadium on Thursday, Benrahma delivered.
Had Ryan not got a fingertip to the forward's early shot as it bent towards the far post, West Ham would have had an early lead.
Benrahma unsettled AZ with his direct running in a period where the home side seemed to have lost their way and then refused to be distracted by the visitors' complaints and Ryan's gamesmanship to find the net with a crucial penalty that breathed fresh life into West Ham's efforts.
With Antonio finding his form again and Bowen a threat, West Ham do appear to be a different side to the one that has struggled all season.
Behind the attacking talent, there is Declan Rice. This was not one of the skipper's most eye-catching nights but his determination to follow Bobby Moore and Billy Bonds as West Ham captains who have lifted silverware is clear.
He covered so much ground to keep AZ out. No matter what the future holds, no-one could accuse the England man of not giving everything to the Hammers' cause.
Mr 'Moneyball' watches AZ defeat
The presence of AZ's very famous minor shareholder in the directors' box brought a touch of glamour to the evening, even if Billy Beane himself is no Brad Pitt, who played the 61-year-old in the film of how his Moneyball data analytics theory transformed the fortunes of the Oakland Athletics' MLB franchise.
There was no fantasy to AZ's approach either.
It soon become apparent they would be happy to take their time with set-pieces, stroke passes around their back-line and generally try to prevent West Ham gaining any momentum.
They were also given assistance with their goal as first Tomas Soucek failed to get out quickly enough to put pressure on Reijnders as he took aim, then Areola, the home side's regular European keeper but club back-up to Lucasz Fabianski, let the Dutchman's shot beat him by his post.
After the game head coach Pascal Jansen said the players' families had to be moved because of the way West Ham fans reacted to the goal.
AZ have never beaten an English side away from home in six previous attempts. For a long time, it did appear as though that unhappy statistic was about to change.
West Ham eventually clicked into gear to dash those hopes, although the margin of victory was slim and after winning all eight home games on their run to this stage, the Dutch side will not be giving up just yet.
Player of the match
BenrahmaSaïd Benrahma
West Ham United
Squad number22Player nameBenrahma
Squad number41Player nameRice
Squad number27Player nameAguerd
Squad number4Player nameZouma
Squad number24Player nameKehrer
Squad number3Player nameCresswell
Squad number20Player nameBowen
Squad number9Player nameAntonio
Squad number8Player nameFornals
Squad number28Player nameSoucek
Squad number18Player nameIngs
Squad number11Player nameLucas Paquetá
Squad number13Player nameAréola
AZ Alkmaar
Squad number19Player namevan Brederode
Squad number9Player namePavlidis
Squad number14Player nameMihailovic
Squad number6Player nameReijnders
Squad number16Player nameMijnans
Squad number8Player nameClasie
Squad number7Player nameOdgaard
Squad number3Player nameHatzidiakos
Squad number1Player nameRyan
Squad number31Player nameBeukema
Squad number23Player nameLahdo
Squad number34Player namede Wit
Squad number2Player nameSugawara
Line-ups
West Ham
Formation 4-2-3-1
13Aréola
24Kehrer4Zouma27Aguerd3Cresswell
28Soucek41Rice
20Bowen11Lucas Paquetá22Benrahma
9Antonio
13Aréola24Kehrer4Zouma27Aguerd3Cresswell28Soucek41Rice20Bowen11Lucas PaquetáBooked at 57mins22BenrahmaSubstituted forFornalsat 90'minutes9AntonioSubstituted forIngsat 80'minutesSubstitutes
1Fabianski2Johnson8Fornals10Lanzini12Downes14Cornet18Ings33Emerson49Anang62Potts72MubamaAZ Alkmaar
Formation 4-2-3-1
1Ryan
2Sugawara31Beukema3Hatzidiakos34de Wit
8Clasie6Reijnders
7Odgaard16Mijnans19van Brederode
9Pavlidis
1RyanBooked at 65mins2Sugawara31Beukema3Hatzidiakos34de WitBooked at 16mins8ClasieBooked at 58mins6Reijnders7OdgaardSubstituted forLahdoat 68'minutes16Mijnans19van BrederodeSubstituted forMihailovicat 80'minutes9PavlidisSubstitutes
12Verhulst14Mihailovic17Barasi23Lahdo25Bazoer27Vanheusden28Buurmeester35Meerdink46Goes54DeenLive Text
Match ends, West Ham United 2, AZ 1.
Second Half ends, West Ham United 2, AZ 1.
Substitution, West Ham United. Pablo Fornals replaces Saïd Benrahma.
Attempt blocked. Vangelis Pavlidis (AZ) right footed shot from the right side of the box is blocked. Assisted by Yukinari Sugawara with a cross.
Offside, AZ. Pantelis Hatzidiakos tries a through ball, but Mayckel Lahdo is caught offside.
Attempt saved. Tomás Soucek (West Ham United) header from the left side of the box is saved in the centre of the goal.
Attempt blocked. Saïd Benrahma (West Ham United) right footed shot from the left side of the box is blocked. Assisted by Lucas Paquetá.
Attempt missed. Saïd Benrahma (West Ham United) right footed shot from the left side of the box is high and wide to the right. Assisted by Danny Ings.
Attempt blocked. Mayckel Lahdo (AZ) left footed shot from the right side of the box is blocked. Assisted by Sven Mijnans.
Attempt blocked. Sven Mijnans (AZ) left footed shot from a difficult angle and long range on the right is blocked.
Substitution, AZ. Djordje Mihailovic replaces Myron van Brederode.
Substitution, West Ham United. Danny Ings replaces Michail Antonio.
Attempt missed. Thilo Kehrer (West Ham United) left footed shot from outside the box is high and wide to the left. Assisted by Jarrod Bowen.
Goal! West Ham United 2, AZ 1. Michail Antonio (West Ham United) right footed shot from very close range to the centre of the goal following a corner.
Attempt blocked. Nayef Aguerd (West Ham United) header from very close range is blocked. Assisted by Declan Rice.
Attempt missed. Kurt Zouma (West Ham United) with an attempt from very close range misses to the left. Assisted by Jarrod Bowen with a cross following a corner.
Corner, West Ham United. Conceded by Mees de Wit.
Corner, West Ham United. Conceded by Sven Mijnans.
Tijjani Reijnders (AZ) wins a free kick in the defensive half.
Foul by Tomás Soucek (West Ham United).