West Ham United fans arrived at rain-lashed London Stadium expecting to see their side make it seven successive home victories for the first time this century.

But having been spoiled by all that recent success on the green, green grass of home, they departed reflecting on a dismal day of disappointment that saw Crystal Palace snatch the winner with just 40 seconds remaining to record their first Premier League away victory since late April.

Against the run of play, Saïd Benrahma had given West Ham a 20th-minute lead with an 18-yard thunderbolt but the Algerian’s fourth goal of the season was then wiped out by Wilfried Zaha just before the break.

And in a confusing, controversial finish, the Hammers saw referee Paul Tierney’s pitchside review deny a late penalty to substitute Michail Antonio before Michael Olise claimed all three points with that late strike which sends Palace up to ninth.

Having rounded off their UEFA Conference League Group B campaign with a perfect six-out-of-six record ahead of next March’s last 16, David Moyes turned his team’s attention to their final two Premier League fixtures before the 2022 FIFA World Cup break.

And after seeing that the kids were alright during his young side’s free-wheeling 3-0 victory over FCSB in Bucharest, the Scot made 11 changes, swapping the youthful exuberance of Thursday’s Romanian romp for, arguably, his strongest available starting line-up.

That meant a timely return to first-team action for Lucas Paquetá, the Brazilian having recovered from a tricky shoulder ligament injury ahead of the big kick-off in Qatar in a fortnight’s time.

With the rain tumbling from the Stratford skies, though, the Hammers record-signing struggled to get a foothold on the slippery surface in the opening exchanges and with Palace simply taking the game to West Ham, Eberechi Eze forced Łukasz Fabiański into a low save before also blasting wide.

In reply, the best the Hammers mustered was a wayward effort from another World Cup hopeful, as Jarrod Bowen’s 20-yarder flew wide, but on 20 minutes Paquetá did finally find his feet to help his side take the lead against the run of play.

Winning possession inside the final third, Tomáš Souček - making his 100th Premier League appearance in claret and blue - squared to Thilo Kehrer and he nudged sideways to Paquetá who instinctively played the ball forward to Benrahma.

Holding off Jordan Ayew, the Algerian international sent an unstoppable 18-yarder scorching across Joachim Andersen’s desperate lunge and beyond the despairing dive of Vicente Guaita as it steamed into the net.

Palace's 1-0 victory over Southampton last Saturday had seen them start the day in 11th place – three places and two points above the Hammers – and they made three changes as Ayew, Nathaniel Clyne and Cheick Doucouré came in for injured Odsonne Édouard plus substitutes Luka Milivojević and Joel Ward, who joined former Academy of Football graduate James Tomkins on the visitors’ bench.

Patrick Vieira’s side had failed to win any of their previous seven away matches but despite trailing once more they continued to boldly press forward in search of an equaliser with an attacking trident of Zaha, Eze and Ayew looking particularly bright in deep in East End territory.

Sure enough, five minutes before the break they got their reward for their continuing endeavour and enterprise, as the Hammers pressed the self-destruct button.

There appeared to be no danger when Fabiański rolled the ball to Craig Dawson who having played it on to Kehrer then saw the German international disastrously mis-control on the right-hand touchline.

Eze stole in and released Zaha into the area and, holding off Dawson, the Palace striker calmly fired beyond the helplessly-exposed Hammers keeper from 12 yards to make it half-dozen goals for the season and send both sides in level at the interval.

Moyes replaced an out-of-sorts Gianluca Scamacca with Antonio for the restart but despite changing the focus of his attack, he could only look on as Eze and then Olise curled angled 18-yarders beyond the far post.

As the hour-mark approached, the Hammers finally won their first corner of the afternoon but when Bowen sent the flag-kick deep, Guaita and Dawson both collided with the far post and, while both were innocuously going in pursuit of the ball, the home centre-back was curiously cautioned by referee Tierney.

In truth, West Ham were getting nowhere and that was the catalyst for Moyes to introduce Manuel Lanzini and Flynn Downes at the expense of centurion Souček and Benrahma, whose departure was not taken gladly by the disappointed locals, who gave the Hammers goalscorer a prolonged and vociferous standing ovation.

Still Palace prodded and probed without finding the final ball, while Kehrer glanced a stooping header into Guaita’s gloves and skipper Declan Rice lashed a long-ranger high into the home fans, who were becoming increasing dejected by the continuing deadlock.

Then, 10 minutes from time, the frustration grew greater when Lanzini sprung Antonio upfield and, having just cleverly spun Andersen on the halfway line, the Jamaican international then tumbled to the deck as he sprinted past Marc Guéhi, a split-second before Guaita bravely dived into his studs.

Referee Tierney instantly pointed to the spot before eventually visiting his pitch-side monitor and confirming that his eyes had, indeed, deceived him and he reversed his decision to a cocktail of Cockney consternation and the relief of the Palace skipper.

Still the late drama was not over, though, and with Paquetá having now hobbled off, Antonio again broke forward into the area in the dying seconds but with claret and blue shirts on hand awaiting a routine byline cross into the danger zone, the Hammers substitute only succeeded in chipping a simple catch to Guaita.

With one last roll of the dice, the Palace keeper instantly bowled the ball to Eze, who burst forward before finding Zaha and, with the ball having now been swept from left to right, Olise’s curling 18-yarder took a cruel nick off Kurt Zouma before looping over the flying Fabianski to give the visitors that long-awaited away victory and leave West Ham reflecting on a very poor Sunday at the office.

West Ham United: Fabiański, Kehrer, Cresswell, Zouma, Dawson, Rice, Souček (Downes 64), Paquetá (Fornals 90+3), Bowen, Benrahma (Lanzini 64), Scamacca (Antonio 46). Unused subs: Areola, Coufal, Ogbonna, Aguerd, Emerson.

Crystal Palace: Guaita, Clyne, Mitchell, Guéhi, Andersen, Doucouré (Milivojević 76), Olise, Schlupp, Zaha, Eze, Ayew. Unused sub: Johnstone, Whitworth, Ward, Tomkins, Mateta, Hughes, Ebiowei, Riedewald.

Booked: Dawson (59), Ayew (88).

Referee: Paul Tierney.