Ole Gunnar Solskjaer believes the pain of the late collapse against Everton inspired Manchester United to edge past West Ham in the FA Cup fifth round.

Scott McTominay's goal, seven minutes into extra-time, earned United a 1-0 win over the Hammers in a match the Red Devils dominated, leading the shot count 17-3.

Three days earlier, Solskjaer's side let a 2-0 lead slip and then conceded a stoppage-time equaliser in a 3-3 draw against Everton that dented their Premier League title bid.

Following some soul-searching after dropping the precious points at Old Trafford, Solskjaer believes United responded in the best way possible to advance to the FA Cup quarter-finals.

"We needed to have a good result and a good feeling today because we were low after the Everton game. It's hard to take but they were really focused and did the job," Solskjaer said.

"Of course you want to win every game. We want to challenge and we want to go to the final. That's what we're here at Manchester United for.

"Sometimes you're lucky with draws in the cup – we haven't been that lucky – but obviously we move another step closer to the final."

David Moyes' side defended resolutely throughout the tie but when Rashford cushioned the ball for McTominay to lash in his seventh goal of the season, there was no coming back for the visitors.

"I felt we dominated. I thought we were in complete control of the first half," Solskjaer said.

"In the second half it became more of a game. When it's only 1-0 and we are wasteful, anything can happen to us – we knew that from the last game.

"It's just about finishing the game off but we're through. We're in the hat and that's what we wanted.

"I think we got about 15 to 17 shots in the end but we need to be more clinical. We should've finished the game off earlier and finished in 90 minutes but sometimes it doesn't happen."

Of United's attempts, five were on target and nine were blocked, with Lukasz Fabianski making four saves in total. In contrast, Dean Henderson made just one, with West Ham's tally of shots the lowest by a team to take an FA Cup tie to extra-time since Bury against Bradford City in January 2016.

Harry Maguire admitted United were hurt by Saturday's result.

"I thought the performance was good, we could have been a little more clinical," Maguire said.

"We dominated the game, especially the first half, they had a little spell after half-time but we dealt with it a lot better than we did against Everton.

"It was good we dug in, thought we got the win we deserved and we're in the hat, that's what we came here to do.

"Saturday night was tough, very tough. So disappointed to concede with the last kick and we felt like we deserved the points – the way we conceded as well was disappointing.

"It shows a great spirit, great mentality to come back, perform, get our heads back up.

"We know it’s a long season, games every three days, it's the best thing when you’re disappointed, it's perfect when the games come so soon."