Destiny dictated that the script had already been written and theatrical Italian Paolo Di Canio did not disappoint when he drew down the curtain on the Upton Park stage that he has made his own, by stepping off the bench to fire home the winner that keeps the Hammers survival hopes alive.
"With Paulo waiting in the wings, it just had to be," said caretaker boss Trevor Brooking after seeing his side, temporarily at least, claw themselves out of the bottom three. "I knew if it was level I would be using him.
"This result means a lot to everyone. The players have come up with the goods and now we march on asking questions of Leeds and Bolton." With Brooking bravely going for broke via an 80's style 4-3-3 formation, the do-or-die Hammers were soon on the attack.
In the opening moments, Jermain Defoe scuffed a 12-yarder to Carlo Cudicini, Frederic Kanoute forced the Blues keeper to acrobatically tip over his looping header and then Les Ferdinand sent a rising volley into the frenzied home crowd.
In reply, Gianfranco Zola's 25-yard shot cleared the Hammers bar and midway through the half Rufus Brevett cleared much maligned ex-Hammer Frank Lampard's point-blank header off the line.
Trevor Sinclair's volley then cannoned off Cudicini's knees while Steve Lomas glanced wastefully wide as it ended goalless at the break.
Ten minutes into the second period, Kanoute headed inches wide before Brooking introduced Di Canio for that East End farewell.
And with 20 minutes left, the irascible Italian arrived right on cue to slam home Sinclair's low cross into the six-yard box.
That sparked wild celebrations ahead of a nail-biting, frantic finale that saw Lampard force David James into a vital full-length injury-time save.
"When I saw Di Canio on the pitch, I thought: Here is a very dangerous man," said Claudio Ranieri, whose Chelsea side now play Liverpool next Sunday for a place in the Champions League.
Meanwhile West Ham head to Birmingham City on a wing and a prayer, looking to complete their miraculous escape.