Dimitri Payet breaks Accrington hearts with last-gasp winner for West Ham
Dimitri Payet rescued West Ham from more embarrassment with an injury-time free-kick to see off Accrington 1-0 in the EFL Cup.
The Hammers, reeling from four straight defeats in all competitions and amid a backdrop of discontent at their new stadium, were down to 10 men and heading for extra time against the Sky Bet League Two side.
Worse still, they were looking comfortably second best against a team 61 places below them in the League.
But Payet, on as a half-time substitute, spared their blushes with a trademark free-kick from 25 yards to send Slaven Bilic's side through.
It has been an unhappy start to life at the London Stadium for the Hammers, but the club have taken steps to avoid the crowd trouble which marred the recent Watford game by relocating fans and improving the stewarding.
However, the promised beefed up segregation between home and away support appeared to amount to a slightly wider claret curtain draped over the seats.
There will be bigger tests of those improvements than the presence of 600 Accrington supporters, among a total crowd of 39,877, but the so-called 'teething problems' at the ground apparently continued with some fans missing kick-off due to problems with tickets.
Those who were delayed did not miss much, however.
Stanley's small but noisy band of fans almost had something to shout about when captain Seamus Conneely drilled in a low shot which had Darren Randolph scrambling across his goal to palm away.
And the visitors looked far more comfortable on the ball, and in their surroundings, throughout the first half.
Winger Jordan Clark could have darkened the mood further when he met Sean McConville's low cross but only managed to glance the ball wide.
For West Ham, Sofiane Feghouli should have put them ahead when he was played through but delayed his shot allowing Janoi Donacien to make a well-timed challenge.
Bilic had seen enough and sent for some illustrious half-time reinforcements in the shape of Payet and Manuel Lanzini.
Yet it was McConville who came closest to breaking the deadlock next with a fierce curling effort which Republic of Ireland goalkeeper Randolph had to tip wide at full stretch.
Payet had at least injected some life into proceedings and one run and cross down the left should have resulted in Simone Zaza's first goal for the Hammers had the Italy striker not stabbed his shot straight at Stanley keeper Elliot Parish.
Having brought on Michail Antonio as his third sub, West Ham suddenly found themselves a man down when left-back Arthur Masuaka had to leave the field on a stretcher with three minutes left.
However, with extra time looming Payet was brought down 25 yards out, and with the sixth minute of stoppage time up the France star curled the free-kick home.