Manchester United did not need the four minutes of injury time to sculpt their FA Cup lifeline; merely the prospect of them, with all the attendant connotations that have built up over Sir Alex Ferguson's reign.

When the board went up and the Upton Park PA announcer filled everybody in, there was frustration, bemusement and conspiracy theory among those in West Ham colours. "Where did they find that from? Bloody typical against United," was the gist of the sentiment. "I was baffled by the four minutes," admitted the West Ham captain, Kevin Nolan.

The truth was that it was not so baffling, especially when the rule of thumb about an additional 30 seconds per substitution was applied. The teams made three apiece in the second-half. But there could be no mistaking the foreboding, the impression of a stadium braced for the inevitable. The chuntering had barely subsided when United did what United do.

No player epitomised the narrowing of the visitors' focus better than Ryan Giggs. Moments earlier, the substitute had nodded over when well-placed from Rafael da Silva's cross but his head was up rather than down in the first minute of stoppage time when he wafted a glorious cross-field pass over the top for another substitute, Robin Van Persie, to steal in on James Tomkins' blindside.

Van Persie's finish was breathtaking. He took two touches with his left foot to control and explode away from the West Ham defender before he brought down the hammer with his right to bury the ball inside the far corner. It was his 20th goal of the season and the eighth time he had scored in the final 10 minutes of matches. United have come from behind to win in 12 of their 30 games in all competitions this season. David Beckham was in the crowd to watch his old club and he left with four minutes to go. He should have known better.

"You take away [Lionel] Messi and [Cristiano] Ronaldo and Van Persie is probably the best player in the world," said Joe Cole, West Ham's returning son. "He was playing wide for Arsenal for many years and getting a few injury problems but moving central means there is a bit less running and he can use his technique and finishing, which is just incredible. He is a joy to watch and a pain to play against."

Sam Allardyce, the West Ham manager, suggested that United's £23m summer outlay on Van Persie was a bargain while Nemanja Vidic, the United captain, offered further lavish praise. "It's movement from the book, touch from the book, goal from the book," he said. "It's something they can show to kids. His touch is magnificent and his finishing is top class."

This was almost Cole's day. Back at the club where it all started for him, after his transfer from Liverpool, he crossed for both of James Collins' headed goals, suffered a bloody nose, changed into a shirt without a number and departed upon his substitution to an uplifting ovation. It was a far cry from his first Premier League appearance for Liverpool in 2010, when he was sent off against Arsenal to set the tone for an unhappy spell. "It was the same referee as well," Cole said, with a nod towards Martin Atkinson. "He said to me: 'You lasted longer today.'"

United's opening goal had been marked by slick approach work and a precision finish from Tom Cleverley but Ferguson's team struggled to open up West Ham. Allardyce felt that United "hadn't created an awful lot," and he was left to rue a double miss by the substitute Matt Taylor and Carlton Cole in the 88th minute. "The difference is split seconds," Allardyce said. "They were dead and then a minute or two later … bang, bang, goal."

The replay at Old Trafford will stir memories of the 2001 FA Cup meeting, when Paolo Di Canio beat Fabien Barthez and West Ham won. A reprieved United intend to make no mistake this time.

Man of the match James Collins (West Ham United)