Swansea manager Michael Laudrup had warned his team they may have to suffer in order to end their worrying winless run, their worst run of league form since the 2008-09 season, and so it proved.
There was plenty of anxiety among the home support during a tight first hour, but the Welsh club have opened up some valuable breathing space ahead of the weekend trip to West Ham.
Given both sides poor recent form and precarious position in the table, it was little surprise that the opening exchanges were decidedly cagey.
Swansea had plenty of ball but Fulham had little difficulty in sitting deep and soaking up the pressure.
It took 12 minutes for there to be a genuine effort on goal, with Bony's looping header dropping on the roof of the net from Ben Davies' cross.
A couple of minutes Shelvey fired well over after nice interplay between Pablo Hernandez and Angel Rangel had teed him up on the edge of the area.
Fulham weathered that flurry and carved out the two best chances of the half.
Keiran Richardson's superb set-piece delivery picked out captain Hangeland near the penalty spot, but the Norwegian headed well over.
Alexander Kacaniklic's surging run created another headed opportunity, but Dejageh failed to test Gerhard Tremmel as his effort was straight at the Swansea keeper.
Tremmel then pushed away a deflected Clint Dempsey strike and the tension among the home support was palpable.
Swansea rallied, with Shelvey's fierce drive rattling the crossbar from Hernandez's lay-off.
It sparked a strong start to the second period for the hosts, with Stekelenburg making a superb save to keep Flores' header out of the far corner from Jonathan de Guzman's set-piece delivery.
De Guzman and Shelvey tried their luck from distance, and it was the latter who broke the deadlock just past the hour mark.
Substitute Nathan Dyer set up Shelvey after nice work from Bony and his strike from the edge of the box took a couple of deflections, the second - and most notable - off Hangeland to beat Stekelenburg and nestle in the bottom of the net.
Fulham had to come out in search of an equaliser, and De Guzman almost picked them off with a driving run and left-footed shot that Stekelenburg leapt high to his right to keep out.
The points were sealed with 15 minutes to go. De Guzman's free-kick was flicked goalwards by Flores and hit Berbatov on its way win, leaving Fulham with no way back.
- Sports & Recreation
- Brede Hangeland
- Wilfried Bony
- Dimitar Berbatov
- Maarten Stekelenburg
- Ashkan Dejagah