Portsmouth 1 Manchester United 4
Rooney converted a penalty either side of half-time and connected with Ryan Giggs' fine pass after Kevin-Prince Boateng had equalised.
Giggs added a gloss to the scoreline late on as he bent a 20-yard free-kick past Asmir Begovic for the 100th top-flight goal of his career.
United created the first opportunity of the game as Ryan Giggs rolled a corner into the path of Paul Scholes, but the veteran midfielder's strong drive was a yard over the crossbar.
Portsmouth fought back with Jamie O'Hara and Kevin-Prince Boateng combining to send Aruna Dindane clear but the Ivory Coast striker's off-balanced effort was saved by Tomasz Kuszczak.
O'Hara tested the Pole from long range, forcing the United keeper to tip his left-footed strike over the bar, but it was Sir Alex Ferguson's side who claimed the lead.
Rooney and Antonio Valencia exchanged passes and with the England forward in dangerous territory inside the penalty area, Michael Brown appeared to clip his heels as his manoeuvred away from goal.
Rooney converted from the spot for his tenth of the season and it was difficult to see a way back for the Premier League's bottom club.
Credit to the South Coast side who refused to lie down and their persistence was rewarded with a penalty kick of their own - albeit in mysterious circumstances.
O'Hara's free-kick was lofted into the penalty area and as Frederic Piquionne and Younes Kaboul jumped with Kuszczak, assistant referee Simon Beck was frantically waving his flag.
Initial thoughts were a foul on the United keeper, but Mike Dean pointed to the spot with replays indicating a slight shirt pull by Nemanja Vidic on Piquionne, it was far from conclusive.
Boateng ignored the inevitable United protests to drive his penalty home and Portsmouth could have even taken the lead as Dindane wasted another opportunity before half-time, placing a downward header wide.
United took just two minutes to restore their advantage as Darren Fletcher sent Giggs clear and the Welshman picked out Rooney.
The victory was complete eight minutes later with Piquionne shamefully tripping Giggs when he could have cleared and Rooney completed his first United hat-trick for three years.
Portsmouth continued to press in search of an unlikely point with Kuszczak keeping out Boateng's stinging drive and substitute John Utaka hitting the crossbar.
Giggs though delivered a lesson in football a day short of his 36th birthday, curling a sublime free-kick past Begovic.