Everton secured a much-needed first win in five Barclays Premier League games with a battling 2-1 victory at West Ham, who slipped back into the relegation zone.
Louis Saha, who missed the midweek Europa League defeat to Benfica with a calf problem, netted from 20 yards against the run of play on 26 minutes.
Dan Gosling added a second just after the hour, but the Hammers made a fight of it following an own goal by Tony Hibbert.
West Ham's England Under-21 forward Zavon Hines was handed a start for the injured Carlton Cole, having netted a dramatic last-minute winner here against Aston Villa in midweek.
The youngster again looked lively, bursting into the left side of the penalty area, before going down under a shoulder charge from Hibbert, as referee Alan Wiley waved away the half-hearted appeals for a spot-kick.
Everton deployed five in midfield and were content to let West Ham have plenty of the ball, waiting patiently for their chance.
However, Gianfranco Zola's men continued to look dangerous, as Julien Faubert flashed a low cross through the six-yard box following a sweeping passing move.
Hines again caused a threat down the left side, and Scott Parker almost capitalised when he got past Joseph Yobo, but then shot straight at Tim Howard.
The Everton defender redeemed himself when coming across to cut out Parker's through ball, which would have sent Hines clear.
Then, out of nothing, Everton took the lead on 26 minutes.
Tim Cahill battled to hold the ball up on the edge of the West Ham box, before laying it back to Saha.
The French striker, 20 yards out, needed no second invitation - and drilled his first-time shot low into the bottom right corner.
The goal was against the run of play, and left Upton Park in stunned silence - apart from the band of travelling Everton supporters on the far side.
West Ham, who battled back from 2-0 down to draw with Arsenal here last month, immediately looked to get on the offensive again.
Everton, though, had much more composure now, with Belgian midfielder Marouane Fellaini coming into the game.
Saha headed a corner wide as Everton came close to doubling their lead before the interval.
The home side had more impetus at the start of the second half, Junior Stanislas having replaced Jack Collison.
A sweeping long ball forward from Manuel Da Costa almost fell for Luis Jimenez in the Everton box, but he was crowded out.
The Chilean was then replaced by Alessandro Diamanti, who helped turn the game against Arsenal.
Everton also made a change on 57 minutes when Ayegbeni Yakubu came on for Saha, who appeared to be troubled by his calf.
Stanislas, from 20 yards, flashed a low drive just wide.
However, Everton snatched a second on the break after 64 minutes.
Cahill and Yakubu battled for possession at the edge of the penalty area, before the substitute pushed the ball out to Gosling on the overlap down the right.
His first shot was blocked by Robert Green, but the ball fell straight back to the Everton winger, who this time drilled it into the net.
West Ham, though, hit back moments later.
Diamanti sent a deep pass over the Everton defence, on to which Stanislas ran.
The West Ham forward clipped his shot past the advancing Howard, but the ball did not appear to have enough pace to roll over the line and Hibbert looked set to hack clear - only for the defender to boot the ball into his own net as Upton Park erupted.
The West Ham faithful sensed an equaliser, with Diamanti curling a 20-yard effort just over before Hines stabbed wide after getting ahead of Yobo.
Howard saved Diamanti's free-kick and Everton survived a couple of scrambles in the six-yard box as the Hammers were denied a second successive dramatic finale.