Goals from Andros Townsend and Patrick van Aanholt left Palace in the driving seat early in the second half, but United showed remarkable resilience to claim all three points.

The win came courtesy of a superb half-volley from Matic, whose goal helped United reclaim second place from Liverpool in the Premier League.

Although there was more than a hint of fortune about it, United found themselves trailing after just 11 minutes, as Townsend's strike from the edge of the area was deflected in.

Van Aanholt then blasted past David de Gea after taking advantage of the visitors' lack of concentration at the back, leaving United facing the prospect of suffering a third successive Premier League away defeat for the first time since January 1996.

But an excellent Chris Smalling header soon after reduced Palace's lead and that led to a United onslaught, with Romelu Lukaku then showing great patience when drawing the away side level 14 minutes from time.

It seemed Palace had done enough to hold off United's advances and clinch a draw, but Matic stepped up in stoppage time, lashing in his first goal for the club from long range.

The strike clinched an unlikely victory for United and put Mourinho's side back up to second ahead of Saturday's clash with Liverpool.

United are 16 points behind runaway league leaders Manchester City with nine games left - two points above the Reds.

Matic told Sky Sports: "After 2-0 it was very difficult for us to come back because they had the crowd behind them but we showed character.

"We believed until the end and we did exactly what the manager wanted from us. He said at half-time that we had to do more than in the first half and I'm happy for these three important points.

Matic celebrates his superb match-winner. Pic: Getty

Asked to reveal what he had said at half-time, United boss Jose Mourinho said: "I cannot tell you half of the things that I told (to the players).

"I can only tell you the other half, and the other half was about the tactical positioning. In the first half Alexis (Sanchez) was on the left, in the second half he was behind Lukaku.

"Instead of three midfielders we played only with two. We gambled a little bit with a two against two at the back without Matic's protection in front of them.

"The message was: half I cannot tell you because you would have lots of (bleeps) on the television, half of it was tactical information."

Palace boss Roy Hodgson said he was obviously disappointed with the result.

"The only thing that has disappointed me today is the fact once again we go away with no points," Hodgson said.

"I didn't think we were that much in danger. It wasn't even impossible that we'd score the third goal."