Sean Dyche's first anniversary as Burnley manager was soured as a controversial finale to this tie sealed West Ham's progress via two late penalties.
Matt Taylor converted the first 14 minutes from time, awarded somewhat harshly after the home captain, Jason Shackell, tackled the West Ham substitute Kevin Nolan, in the process of volleying. Then another of the contest's late introductions, Jack Collison, doubled the advantage after Keith Treacy raced after Joe Cole in an attempt to make good his goalkeeper Tom Heaton's bodged clearance. To add to the frustrations Treacy was sent off for denying a goalscoring opportunity and will miss Saturday's league match at Millwall through suspension.
"If we've had a bit of luck, we've had a bit of luck," said the West Ham manager, Sam Allardyce. "I can give a definitive on the second one, it was an absolute stonewaller because I was right in front of that – it was a cynical challenge."
The events in the final quarter of an hour were tough on Burnley, who started in the mood to mark Dyche's year in charge with a ninth straight victory in all competitions. His history makers, three points clear at the top of the Championship following their best start to a season since 1897, dominated the opening period and appeared just as likely to progress until the moment Shackell was penalised.
"I asked the referee and he said he was happy with his view," said Dyche. "I wasn't happy with his view. I think it's a very difficult place to see a penalty from, behind the play, through three or four players. It's a very difficult call for a referee to be 100% sure."
Junior Stanislas, keen to make an impression against his former club and expose West Ham's debutant Pelly Ruddock by cutting in from the left at every opportunity, forced Adrián to touch a 12th-minute daisycutter round an upright. From the resulting corner the Championship's in-form striker Danny Ings displayed his predatory instinct by swivelling on the corner of the six-yard box to sting the goalkeeper's palms with a fierce half-volley.
Ings' fellow frontman Sam Vokes later glanced a header on to a post from an offside position as Burnley maintained the upper hand against opponents who had previously scored in only one away match all season – the surprise victory at Tottenham, when Allardyce was lauded for the tactical genius of his 4-6-0 system.
This time he began with a 3-5-2 formation, asking two of the English top-flight's fallowest forwards – Carlton Cole and Modibo Maïga, without a club goal between them in 27 combined appearances stretching back to last December – to alter the sorry statistic. But it was only after a half-time rethink that West Ham prospered. Pressing the ball higher up the pitch soon reaped its rewards andAllardyce's team thought they had a 53rd-minute lead when Maïga's bobbled effort was flicked up into the air and then spectacularly dispatched in overhead fashion by an offside Joe Cole.
Poor finishing from West Ham left things in the balance – one delicious offering from the left by Taylor was spurned by a posse of onrushers – while James Tomkins' downward header was hacked away by David Edgar. But, after Kieran Trippier struck the goalframe for Burnley with a 25-yard free-kick, the dam burst. "We had only one day to get used to the system but it didn't work," confessed Allardyce. "We didn't get to grips with their full-backs overloading us, so we went to a 3-4-3, started passing the ball better, started to create some chances from pressure on the opposition, started to get our 2,500 fans singing, cheering the lads on, and finally they cracked."