Fulham produced a super second-half performance to ease their relegation worries - and threw Portsmouth back into the scrap at the bottom.
Pompey dominated the first half and Lomana LuaLua's goal left Fulham supporters fearing the worst for their side.
But a complete turnaround in the second half and goals from Andrew Cole, Brian McBride and Luis Boa Morte gave the Cottagers a vital win.
Both sides headed into the match in poor form and were looking for a valuable three points to help them pull away from the threat of relegation.
The game got off to a slow start as that form continued in the opening stages, and it was Portsmouth who eventually worked the first opening.
LuaLua caused problems for Fulham down the left flank and drilled the ball dangerously across goal. Pompey midfielder Steve Stone made a late run but was just unable to get a touch on the ball ahead of home keeper Edwin van der Sar.
Eight minutes later the visitors came close again, this time through Patrik Berger. The Czech international looked clear on goal after neat set-up play by LuaLua - but a poor first touch let him down and Fulham breathed a sigh of relief.
The home side struggled to find any threat in the final third and it was Portsmouth who always looked most likely to open the scoring.
And it was only a superb point-blank save from van der Sar which denied them a 22nd minute goal. Stone's cross from the right was met by the head of lively front man LuaLua, but the Dutchman reacted brilliantly to turn the ball over.
It was only a matter of time before the first goal arrived, and although Sylvain Legwinski could have scored for Fulham as he steered a header wide, it was Pompey who went ahead.
LuaLua cut back on the left hand side of the area and took the ball past Zat Knight and Moritz Volz before superbly steering a curling shot into the bottom corner of the net from 18 yards.
Jensen headed over for the Whites after 36 minutes, but it was on the stroke of half-time that the Cottagers should have levelled.
Dejan Stefanovic handled in the area from Cole's cross and referee Mark Clattenburg pointed straight to the spot.
However, Steed Malbranque's penalty was saved as Jamie Ashdown dived to his left.
After the break Berger shot just wide following more good link-up play with LuaLua, but it was in the final 30 minutes that Fulham finally came to life.
Boa Morte worked brilliantly down the left flank before pulling the ball back to Cole, who expertly side footed into the top corner to equalise after 63 minutes.
Five minutes later Malbranque fizzed a shot wide, but Fulham looked like they could turn the game on its head and produce a winner.
With 15 minutes left Cole almost grabbed a second. He slid in to latch on to a Malbranque cross, but his effort hit the inside of the post and rebounded back into play.
Moments later Yakubu fired wide for the visitors, but eventually it was Fulham who found their second goal.
Arjan De Zeeuw tried to head back to his goalkeeper but substitute McBride intercepted and sent a looping shot over Ashdown and into the net nine minutes from time.
In the dying stages Boa Morte robbed Linvoy Primus and rounded Ashdown to slot the ball home and make sure of the points.