The Red Devils squandered an unbelievable number of scoring opportunities in the first half, with misses coming from a variety of players such as Alejandro Garnacho, Bruno Fernandes, Casemiro, and Diogo Dalot.
It took United just two minutes to offer the home side their first warning, when winger Garnacho rattled the crossbar from a Fernandes cut-back.
Garnacho’s second bite at the cherry six minutes later was not much better, as he shot wide when put through on goal by Fernandes.
Fernandes then went from creator to culprit when he failed to trouble Lukasz Fabianski with his free header from a Casemiro cross after 13 minutes.
But the worst miss of all was from Dalot, who after being put through by Fernandes on 32 minutes, neatly touched the ball past Fabianski to put himself through on goal, before inexplicably failing to find the net.
There was still time for two more clear chances from set pieces for United before the break. First a Christian Eriksen corner was headed onto the post by West Ham’s Edson Alvarez, then the Dane’s free kick found Casemiro’s head, but Fabianski reacted well.
United’s first-half domination prompted Lopetegui to make three half-time substitutions.
It did prompt an improved second-half performance, although in truth, it did not take much to register a better showing after the low bar of their woeful opening-period showing.
In the 62nd minute, the home side created their first presentable chance of the game when Michail Antonio bustled down the touchline and cut the ball back to Emerson Palmieri, who could not sort his feet out to beat Andre Onana in the Manchester United goal.
It was a warning United failed to heed, as West Ham looked the better side in the second half.
On 74 minutes, they made their improvement count with a goal from substitute Crysencio Summerville.
United’s attempt to play out from the back was sloppy and once West Ham robbed them off possession, they played a series of quick, incisive passes that set up another substitute Danny Ings inside the box.
The former England striker mishit his shot but it fell kindly to Dutch winger Summerville, who slid the ball home.
That seemed to finally rouse United from their second-half hiatus, and seven minutes later they were level after Casemiro headed home after redirecting a Joshua Zirkzee header that was going wide.
But the drama was not over yet.
In added time came video assistant referee (VAR) assisted drama.
Matthijs de Ligt was harshly judged to have impeded Ings inside the box, and after the incident was flagged by the VAR, referee David Coote checked the pitch-side monitor and decided to award the spot kick, which Jarrod Bowen dispatched past Onana to seal the win.
In the day’s other matches, Crystal Palace beat Tottenham Hotspur 1-0 thanks to a Jean-Philippe Mateta goal to finally claim their first win of the season and climb out of the relegation zone.
Palace scored on the half-hour mark when Daniel Munoz pinched the ball from Spurs centre-back Micky van de Ven and put a cross into the box which was expertly flicked by Eberechi Eze to an unmarked Mateta who fired home at Selhurst Park.
Meanwhile, goals by Nicolas Jackson and Cole Palmer earned Chelsea a 2-1 home win over Newcastle United in the latest sign of progress for the Blues under manager Enzo Maresca.
Between the goals, Newcastle equalised against the run of play through Alexander Isak.