Wigan Athletic have dumped West Ham out of the FA Cup, the Latics winning 2-0 at the DW Stadium.
The Hammers, who have improved under David Moyes, were reduced to 10 men early in the second half when Arthur Masuaku was sent off.
By that time they were already one down with Will Grigg scoring for the League One side.
He doubled Wigan's lead from the penalty spot on 62 minutes and the 2013 winners, top of League One, are in the draw for the fifth round.
The Hammers have climbed out of relegation trouble and are 11th in the Premier League table but they are still only four points away from the bottom three in a congested bottom half of the table.
They are back in league action on Tuesday night with a home game against Crystal Palace, another side who have climbed the table in recent weeks.
They are 2/1 for the win with Roy Hodgson's side 8/5 and the draw is priced at 9/4.
The Hammers are 33/1 to finish the season in the top half of the table.
Wigan's star Grigg said to the BBC after beating the Hammers: "From start to finish we were brilliant, our quality really came out today, It was an enjoyable game to play in. There was only going to be one winner after the first goal went in."
League Two Notts County are also in the draw for the fifth round after they earned a replay against Premier League Swansea City.
Luciano Narsingh had given the Swans the lead at Meadow Lane just before half-time but veteran striker Jon Stead equalised midway through the second half.
Coventry City are the other League Two side definitely through after they beat MK Dons 1-0 away from home.
Southampton beat Watford 1-0 in an all-Premier League game and the other sides who won through to the fifth round include Leicester, Hull, Brighton and Sheffield United.
View all Soccer betting