The Hammers largely dominated the game but it took a powerful header in the 77th minute from the returning Andy Carroll to settle the home fans' nerves after Swansea keeper Gerhard Tremmel had kept the hosts at bay with a string of high-quality saves.
With West Ham’s co-owner David Sullivan announcing during the week that an agreement has been reached with Liverpool for the permanent transfer of Carroll at the end of the season, Sam Allardyce was able to start the on-loan front man for the first time since late November - in a move that proved decisive for the hosts.
It was Carroll’s deployment as a focal point that engineered the game’s two best early chances, though Kevin Nolan and Mohamed Diame were unable to make much of their respective knockdowns.
As the half developed it was Tremmel who provided the difference between the two, thwarting Hammers captain Nolan with two smart saves in quick succession – firstly a close-range stop with the legs and secondly at full-stretch after Nolan met Carroll’s smart header.
Tremmel intervened yet again to block Ricardo Vaz Te’s viciously driven, near-post effort before referee Lee Probert ended the home side’s snowballing momentum by blowing for half-time.
West Ham started the second half in much the same manner they finished the first, though after carving a decent opening, Carroll could only blaze over after a neat exchange between Nolan and Matt Jarvis.
Swansea began to show signs of life with Michu spurning two decent half-chances before Swansea left-back Ben Davies denied Vaz Te with a glorious sliding challenge on the edge of six-yard box.
The home crowd’s frustration started to become evident when Tremmel blocked Carroll’s somewhat tame effort with his legs leading to Diame, in the same passage of play, wildly miscuing after attempting the acrobatic.
But West Ham’s relentless pressure finally paid dividends late on, with Carroll’s breakthrough coming in predictable fashion, as the England international rose highest to power home a Mark Noble corner with just over 15 minutes left to play.
The goal seemed to spark some life into Swansea, yet Michael Laudrup's side were unable to provide the quality in the final third that had evaded them all game and West Ham held out to secure a narrow win to ease the pressure on boss Allardyce.