Substitute Harvey Barnes struck twice as Newcastle United fought back from 3-1 down to beat West Ham United 4-3 in a thrilling Premier League match at St James’ Park on Saturday.

Jarrod Bowen had put West Ham 3-1 ahead soon after halftime up but Alexander Isak’s second penalty 13 minutes from time gave Newcastle hope and the livewire Barnes equalised with a clinical finish.

Barnes then lashed in a sweet shot from outside the box in the 90th minute to spark delirious scenes of celebration.

“A lot of emotions in that game, we were swinging all over the place really, ups and downs, injuries, sending off but just brilliant from the lads, brilliant comeback when it was a real challenge at 3-1 down,” coach Eddie Howe told TNT.

Newcastle climbed three spots to eighth in the table on 43 points after 29 games, a point behind West Ham in seventh.

The hosts had started well and led through Isak’s early penalty before Michail Antonio and Mohammed Kudus put West Ham 2-1 up at halftime.

Bowen extended the visitors’ lead with his 15th Premier League goal of the season, before Barnes entered the fray in the 67th minute.

His second goal put the hosts ahead and although Newcastle forward Anthony Gordon was sent off in stoppage time after picking up his second yellow card for kicking the ball away, they hung on.

“It was one of the maddest games I have played in for sure,” Barnes told the BBC. “We were obviously disappointed to be where we are in the game and then we had a mountain to climb. This team is all abut team spirit and never give up and that showed in abundance today.”

Barnes has endured an injury-plagued season.

“So every time I am on the pitch I went to help the team. The atmosphere here is always amazing. Today it is a winner and it is a great feeling.”

On the negative side for Newcastle, who have won only two of their last five matches, were more injury concerns as Jamaal Lascelles, Emil Krafth, Tino Livramento and Miguel Almiron were all forced off the pitch.

Howe praised his squad’s character.

“When you’re 3-1 down at home with the recent run we’ve been on and everything seemingly going against us, very, very difficult for the players to regroup and go again but they did second half and it was just a wonderful feeling at the end,” Howe said.

West Ham manager David Moyes was disappointed after his team’s third match without a win.

“We have lost a game when we should have won a game. In the Premier League,” Moyes told BBC.

“This is a tough place to come and for a long period we looked as though we were going to be the side who finished on top. We didn’t see the job through and weren’t tough enough.”