If anyone had scripted Tuesday night’s farewell to the Boleyn Ground they couldn’t have come up with anything much better than what actually transpired.

Admittedly, there could be a few tweaks in the narrative. The crush that delayed the kick-off could have been avoided with supporters beginning to panic as the Manchester Utd bus stood in the road in a sulk, refusing to budge.

And the scenes of Anthony Martial surging down the left, leaving goalkeeper Darren Randolph flapping in the breeze would have remained on the cutting room floor.

But for heart-stopping and then heart-pounding drama, the swansong at the old ground was matchless.

The mixture of nostalgia, excitement and pride was evident from the start. To a rendition of Abide With Me, a roll-call of players who had played with the crossed hammers on their shirt ran across the big screen.

Applause throughout but cheers for three lost heroes of the Boleyn era – managers Ron Greenwood and John Lyall who were the architects of the great team of the 60s-80s and then, the deafening ovation for Bobby Moore, the icon.

If there was sadness around the ground for any single thing it was the thought of leaving Bobby Moore behind. Of course, he’s making the move to Stratford too but this was the turf – muddy and roiled back then – when he quietly showed his genius and created his enduring legend.

Nostalgia was in the air and the fans played some of their greatest hits “Paolo Di Canio, Paolo Di Canio” they sang for the Italian was waiting for the VIP presentation after the final whistle. Even hostilities were temporarily – very temporarily – suspended when former West Ham academy player Michael Carrick came on as substitute for the Reds. Applause for his services, lifting the FA Youth Cup in 1998-99.

A big crowd, only 500 short of capacity, the England manager Roy Hodgson, former players in the wings and a welter of hot dog sellers, programme wranglers, sweeper-uppers and ticket collectors hoped and wished for a game to match the occasion.

Thank goodness such a game unfolded. And the scriptwriter did the right thing in settling nerves with an early goal, on 10 minutes from Diafra Sakho, scoring on a cutback from Manuel Lanzini.

West Ham could now play the match rather than the occasion and they showed tenacity and inventivess, dominating for long spells without ever really troubling goalkeeper David De Gea.

Michail Antonio was tireless and eventual man of the match Mark Noble everywhere but Andy Carroll was kicking the air, or heading it, and Dimitri Payet’s radar was off.

Fortunately, Manchester Utd were not in the game. Wayne Rooney was huffing and puffing and finding some joy working with Mata and Valencia but the whizkids – Anthony Martial, Marcus Rashford – were not in the park.

Corners and freekicks came in waves and the ball at one point was bundled in the net but ruled out. Slaven Bilic was on the touchline directing frantically – in contrast to the stoic Louis van Gaal, sourly brooding over the coach incident.

Halfway through the first half and West Ham should have been two up, Carroll having fluffed a one-on-one chance. Manchester Utd were beginning to find their feet, pace and direction and fans feared that if the Irons failed to capitalise on possession – and Payet’s boot – there was a chance the opposition could sneak something.

And so to part two when Manchester Utd came out with more drive, verve and commitment with the frontmen getting more service and having been told to do something aggressive or useful with it.

Martial’s two goals on 51 and 72 minutes became inevitable despite his individual skill. They looked the same with him surging down the left and slotting into the net despite the impossible angle.

2-1 down. On this night of all nights. Fans were beginning to console themselves that at least there would be a fireworks display regardless. Bilic was furious on the touchline at every slight transgression or missed beat, clashing with, then charming, Van Gaal in that Super Slav way.

Free kicks for West Ham (and yellow cards for Manchester Utd) came thick and fast. Payet on the ball, trying to give the fans what they wanted – a curling stunner – but nothing. The crowd was nervous, silent.

Andy Carroll does what he does in these situations, chased down and chopped down an opposition player through frustration. The small pocket of Manchester United fans were making all the noise in the stands, the Manchester United players making all the running on the pitch. Noble, shiny with sweat, taking hits for the team to grind something from this game. The bubble not bursting, but wilting.

Then, after a prolonged coffee break, the scriptwriter picked up his pen and begins to craft the final act. And what a final act.

On 76 minutes Michail Antonio, full of effort all evening down the flanks, finds space picking up the pieces of another failed free kick and heads the ball straight at the Bobby Moore stand with only the bulging net in his way.

2-2. Game on. Game on, boys.

But a draw is not enough, not tonight, and we’ve moved past the point when the crowd want to win the match to the point where they need to win the match. They demand it. West Ham have clawed back one goal, why not another? History would not forgive anything short of blood and sweat on this shiny, imperilled turf.

Another Payet free kick. Winston Reid, up from the back, gets a head on the ball. De Gea gets a hand on it. A weak hand though. Not enough. A goal.

3-2. The dream. 3-2 is the dream.

Nine minutes now. Nine minutes plus injury time. Substitutions help to speed the treacle clock as does loitering at the corner flag but Manchester Utd, and Anthony Martial, are never out the game. Belatedly, they are hungry with Rooney orchestrating passes to the wide men for searing, nerve-jangling crosses into the box. The West Ham defence had been strong all evening and now they are strong and brave, putting their bodies between the ball and a numbing 3-3 scoreline.

Injury time. The final four minutes of the Boleyn Ground’s 112 year history. Four minutes to hold out and ensure that tens of thousands of West Ham fans can use their “five-goal thriller” phrase in the tale they would tell of this night, again and again and again.

Final whistle.