Carlton Cole scored a wondergoal and was then sent off as West Ham beat ten-man Wigan at the JJB Stadium.
Cole got the winner in the 34th minute, finishing off a sublime one-touch Hammer's passing move which ripped the Wigan defence apart.
But the England striker's joy changed to despair just three minutes later when he received his marching orders for a high challenge on Emmerson Boyce - his second yellow card of the game.
But Wigan were themselves reduced to ten men in the second period as Lee Cattermole was sent-off for a crunching tackle on Scott Parker as the Hammers held firm.
The result means West Ham have pulled four points clear of the Latics in the chase for Uefa Cup qualification via the league.
Referee Stuart Attwell's card-happy antics will be the main talking point - as well as the two red cards, Attwell issued six yellow cards, not including Cole's first, in a niggly game which threatened to descend into a nasty affair at one point.
It overshadowed the excellence of West Ham's goal - a rare bright spot on an evening where beauty came a distinct second to beast.
Early on, two fouls by Lucas Neill allowed Amr Zaki and Mido to test goalkeeper Robert Green with free-kicks.
Green's counterpart Chris Kirkland did just enough to put off Cole as he raced on to Radoslav Kovac's defence-splitting through-ball, with the West Ham striker commendably staying on his feet instead of opting to throw himself to the floor in the penalty area.
In the 28th minute Mark Noble tripped Cattermole after he skipped past a couple of challenges and he was booked.
Cole followed into referee Attwell's book for a late tackle on Michael Brown.
However, the striker made amends in impressive style in the 34th minute when he provided the finish to a slick passing move.
Parker slid the ball into David Di Michele who exchanged passes with Noble before playing in Cole on the left of the penalty area and the striker opened his body before curling a shot beyond Kirkland and into the far corner of the net.
Just three minutes later, after Parker had been booked for raking his studs down Michael Brown's shin, Cole got himself sent off.
His raised foot as Emmerson Boyce went to head the ball could have been construed as dangerous and Attwell produced a second yellow card and then a red, which then sparked a confrontation between Parker and Brown which saw Brown cautioned.
Wigan pressed for an equaliser and in first-half stoppage-time Mido headed Charles N'Zogbia's left-wing cross wide.
Neill, who rode his luck in the first half, was booked in the 49th minute for a late and high challenge on Cattermole - his studs were showing and he was lucky not to be sent off.
But Cattermole pressed the self-destruct button two minutes later when he jumped into the back of Parker and was shown a straight red card.
Valencia was next into Attwell's book for obstructing Herita Ilunga in the 60th minute, before a chance fell to Titus Bramble after Boyce and Mido had knocked down N'Zogbia's corner but he blazed well over.
With 14 minutes to go, Jack Collison, under no pressure from anyone, collapsed in agony as he tried to control the ball on the right touchline.
Jonathan Spector was brought on to replace him while the youngster was still receiving treatment and he eventually departed on a stretcher with his right ankle strapped up.
He was the second West Ham player to leave the field in such circumstances in successive matches after fellow midfielder Valon Behrami sustained a serious knee injury on Sunday.
Valencia had a long-range effort saved by Green and Hugo Rodallega's overhead kick went wide as even six minutes of added time were not enough for Wigan to grab an equaliser.