Manchester United 2 Portsmouth 1
On a night when two key decisions went against United, Rooney scored both the home side's goals in a brilliant seven-minute spell after replacing Ole Gunnar Solskjaer on the hour.
Rooney scored his first goal in seven games at Arsenal in the Premiership last Sunday and made his first impact in this Cup tie after 77 minutes.
Henrik Larsson's clever pass found Ryan Giggs on the left side of the Portsmouth box. The Welshman looked up before crossing into the centre where the unmarked Rooney was left with a simple right-foot tap-in from six yards.
If that goal was easy, his second was spectacular.
Picking up a loose ball 20 yards out, the England star took it on a couple of paces before scoring with an audacious right-foot chip into the top corner of the Pompey net.
But United never make things easy and unambitious Portsmouth snatched a goal three minutes from time.
Substitute Kanu laid the ball to Pedro Mendes just outside the United box and his low shot from 20 yards beat United goalkeeper Tomasz Kuszczak after taking a deflection off central defender Nemanja Vidic.
United could have had a third goal with seconds left when the dynamic Ji-Sung Park burst into the left side of the Pompey box and fired in a shot from eight yards which beat goalkeeper David James only to go wide off the outside of a post.
It could have been so different for United who were left seething by two controversial decisions which both went against them.
The first came after 13 minutes. Giggs curled his corner to the near post where Vidic powered in to meet it with a bullet header from six yards.
James dived across his goal to parry the ball away but it had clearly crossed the line before it was booted clear by Mendes at the far post.
Referee Mike Riley allowed play to go on to the anger of the United players. It must have seemed the supreme irony for Mendes.
Playing for Spurs in a Premiership game at Old Trafford in January 2005 the Portuguese star had seen a goal of his own chalked off by referee on the day Mark Clattenburg.
Mendes had spotted then United goalkeeper Roy Carroll off his line as he raced down the right at the same end as he was for today's clearance.
Looking up, Mendes sent his speculative 40-yard shot goalwards, only to see Carroll drop the ball over his head and over the line.
Carroll quickly recovered to scoop the ball back into play, even though it had gone over a foot beyond the line, but escaped as Mr Clattenburg did not see the incident and the game ended goalless.
Portsmouth enjoyed another slice of luck after 38 minutes. Giggs capitalised on sloppy Pompey defending to race down the left.
He dragged the ball back into the centre from the left edge of the box, but it went just behind Larsson standing on the penalty spot.
Pompey defender Sol Campbell could not stop himself touching it back towards goal and it took a spectacular save by James to save the day for his side.
James was again the hero as, from the ensuing Giggs corner, the former England goalkeeper superbly tipped over Michael Carrick's header from eight yards.
United's luck was out again 11 minutes after the break. Carrick's delightful flick found Larsson racing into the Pompey penalty area and he hit the back of the net with a rasping right-foot volley.
But the linesman's flag was raised for offside against the Swede despite him clearly beating the Pompey trap.