Manuel Pellegrini was left counting the cost of wrong offside calls for the second week running after Leicester snatched a point at West Ham.

With the Hammers leading 2-1 in the final minute, substitute Lucas Perez rounded Foxes keeper Kasper Schmeichel and rolled the ball into the net.

The Spaniard was flagged offside, although replays showed he was level with Ben Chilwell when he latched onto Pedro Obiang’s through-ball.

Two minutes later Leicester equalised when substitute Harvey Barnes clipped in his first goal for the club to secure a 2-2 draw and leave Pellegrini frustrated again.

“Thankfully VAR isn’t out yet, so it’s worked for us today,” admitted Leicester boss Brendan Rodgers.

Just last weekend Felipe Anderson had a goal wrongly chalked off for offside as West Ham slipped to a 2-1 defeat at Manchester United.

And Hammers chief Pellegrini said: “Unfortunately for us, we have lost five points.

“Maybe if we had the points that we deserved from our last game against Manchester United and then today, we would be fighting for the seventh position in the table.

“But it is part of the game. When you have two games in a row with such big mistakes then of course it is difficult to understand or accept, but you must do it.”

The last-gasp equaliser pulled the rug from under West Ham on the day they rolled out their new claret carpet.

The Hammers took the lead in the 37th minute when Mark Noble flighted in an inviting cross for Michail Antonio, who got in front of Ben Chilwell and headed powerfully past Schmeichel.

The winger charged off the pitch onto the new track covering and gave it a stroke in celebration.

Not since Aladdin has a carpet had so much attention – the Hammers fans even came up with a song dedicated to it in the second half.

However, West Ham were twice floored by equalisers, first in the 67th minute when Chilwell’s low cross was met by Jamie Vardy.

Perez pounced nine minutes from time when he converted the rebound after Obiang’s shot came back off a post, but after his second strike was ruled out Barnes’ big moment arrived.

The 21-year-old, recalled from a loan spell at West Brom in January, opened his Foxes goal account from a Youri Tielemans through-ball.

“It’s a really special one,” said Rodgers. “He’s a young player who’s come though the system, done his loans, and it’s a big jump from the Championship to the Premier League and he’s done very well.

“I took him out of the team so he could come on and make an impact. I’m delighted for him, it was a great moment for a young English player.

“In the second half we showed a great mentality. I picked up early on that they are a good bunch of boys who work hard, and we’ve tried to create a spirit that digs out results. To come from behind twice was very pleasing.”