United began as if they would blow Pompey back to the South Coast with their tails firmly between their legs. Ryan Giggs and Ruud Van Nistelrooy both went close before United went ahead in the fourth minute.
Van Nistelrooy found Giggs in the Pompey box and, as he turned Linvoy Primus, the defender brought him down.
The Dutchman stepped up to drive the resulting penalty into the bottom corner of the net as Pompey goalkeeper Shaka Hislop had dived to his left .
In the 17th minute Lassina Diabate brought down Gary Neville 30 yards from the Pompey goal on the right.
Up stepped David Beckham to hit a glorious free-kick beyond Hislop and into the top left corner of the net.
United squandered numerous chances and looked to be well in control until Portsmouth reduced the arrears seven minutes before the interval.
Pompey striker Svetoslav Todorov went in for the ball with United goalkeeper Roy Carroll and it fell loose for Steve Stone to score with a left foot shot from four yards.
Portsmouth were a different side in the second half and should have been level in the 66th minute. Substitute Gary O'Neil's intelligent pass saw Nigel Quashie sprint clear of the United defence from just inside his own half.
But, with only Carroll to beat, from the edge of the area he inexplicably lofted his shot over the bar.
It was the metaphorical kick up the backside which United needed.
Rio Ferdinand's header from Beckham's 68th minute corner was cleared off the Pompey line by Kevin Harper, but worse was to follow for Portsmouth with nine minutes to go.
Foxe brought down Van Nistelrooy in the Pompey box as the United striker looked to be heading nowhere and the Dutchman stepped up for penalty number two, again sending Hislop the wrong way.
Then, in the dying seconds, Paul Scholes rubbed salt into the wounds when he was on the end of Wes Brown's long pass to chip the ball beyond Hislop and into the net from ten yards out.