Two goals in six second-half minutes snapped West Ham's frustrating run of five straight npower Championship draws and moved Sam Allardyce's men within a point of second-placed Reading.
The Hammers' frustration looked set to continue in a goalless first half at London Road but Ricardo Vaz Te headed the opener on 51 minutes and Gary O'Neil added his side's second in the 57th minute.
Middlesbrough missed the chance to leapfrog Brighton into fourth place as they were held 1-1 at Ipswich. Lukas Jutkiewicz put Boro ahead in the 63rd minute but Grant Leadbitter equalised 11 minutes later.
Copyright (c) PA Sport 2012, All Rights Reserved.