Wigan Athletic netted four times at Upton Park in the all-Premier League third-round Capital One Cup match this evening.
Hosts West Ham went ahead inside the first 10 minutes when summer signing Modibo Maiga burst into the area and fired past Ali Al-Habsi.
Wigan were back on level terms soon after, however, as Mauro Boselli poked home Callum McManaman's centre at the near post.
The Latics then went ahead in the 38th minute when right-back Ivan Ramis was allowed to run from halfway before cutting inside and fizzing in his first goal for the club.
There was time for another Wigan goal before the break and it was Boselli who again struck. The Argentinian sprung the offside trap and showed composure in front of goal by lifting over Stephen Henderson.
The Hammers couldn't find a goal to ignite a comeback after the interval and Wigan went on to get a fourth when Henderson brought down James McArthur in the area, with substitute Jordi Gomez finding the net from 12 yards.
Both sides face an away trip in the Premier League this weekend, with West Ham travelling across London to QPR, while Wigan go to Sunderland.