Van Persie converted a first-half penalty and scored on the brink of half-time before he struck the final goal with a free-kick just after the restart.
The Theatre of Dreams turned into the scene of David Moyes’ worst nightmare on Sunday when United lost 3-0 to Liverpool and questions arose about the manager’s future.
But the United boss got everything spot on against the Greeks on Wednesday night.
The odds were against Moyes. The last time the Red Devils came back from 2-0 down in the first leg was 30 years ago when Bryan Robson inspired the team to a rousing 3-0 win over a Barcelona side that included Diego Maradona.
Tonight it was the turn of another United icon – Ryan Giggs – to boss the game.
Moyes’ decision to deploy the 40-year-old in the middle of the park proved to be a masterstroke as he played a key role in the build-up to the first two goals and excelled throughout.
Moyes, who received support from the Old Trafford crowd throughout, may have endured a terrible domestic season, but his European dream is still alive thanks to this impressive comeback.
The only thing that will worry Moyes is that his hat-trick hero was carried off on a stretcher late on with what looked like a knee injury.
United, knowing only a big win would send them through, went at Olympiakos from the off but they were frustrated by the tenacious visitors, who did everything they could to break play up.
Antonio Valencia jumped for the ball with Joel Campbell and ended up with a black eye that left him barely able to see but the winger continued after treatment.
Kostas Manolas and Alejandro Dominguez saw yellow for petty fouls while Michael Carrick also entered the book for a foul on Hernan Perez.
Perez picked himself up and went down the other end, gaining a yard inside the United box but he fired over. The midfielder fell to the turf and placed his head in his hands. He knew he had missed a gilt-edged chance.
Giggs showed why he was recalled moments later when he lofted a delicious ball over the top towards van Persie. Jose Holebas barged over the Dutchman and the referee had no option but to give a penalty.
Van Persie slotted the ball home with 25 minutes on the clock – exactly the same time that Robson had put United ahead against Barcelona in 1984.
The Olympiacos goalkeeper Roberto then saved superbly from Evra as the pressure mounted.
Then, out of the blue, United were under severe pressure. De Gea saved superbly from Perez and he was back on his feet less than a second later to deny David Fuster.
The double-save lifted the crowd and moments later the decibel level inside the stadium rocketed as van Persie bagged his second of the night.
Giggs, once again, played a key role. The Welshman picked out Rooney with a pin-point pass and the England frontman squared to van Persie, who tucked away the simplest of side-footed finishes.
Moyes knew the job was not complete yet though, and joined his players in jogging away down the tunnel at the break.
Seven minutes after the restart United claimed the third goal they needed. Danny Welbeck went down under the faintest of challenges from Manolas but that did not matter to van Persie.
The striker clipped the ball over the wall and a bamboozled Roberto watched it drift past him. Raucous celebrations ensued, but they soon gave way to a nervous silence as Olympiacos suddenly sprung into life.
Ivan Marcano’s deflected free-kick flew a foot wide and Perez missed another good chance, ploughing his low drive straight at De Gea.
The Spaniard saved well again from Dominguez. An injury to van Persie, who was the victim of a tackle by Giannis Maniatis, meant there were five minutes of added time, but United rode out the storm to make it through to the last eight.