Real Madrid fended off a late comeback from Deportivo Alaves to win 3-2 and ensure Carlo Ancelotti tasted victory in his 300th match.

Reigning LaLiga champions Madrid were cruising to victory at Santiago Bernabeu on Tuesday as goals from Lucas Vazquez, Kylian Mbappe and Rodrygo put them 3-0 up.

Carlos Benavidez and Kike Garcia scored in the 85th and 86th minutes for Alaves but Madrid held on to win a match they had mostly dominated.

Madrid opened the scoring under a minute after kick-off when Vinicius Junior took a long Federico Valverde pass in his stride and ran up the left channel before setting up full-back Vazquez, who fired home from close range.

Los Blancos extended their lead in the 40th minute when Mbappe played a neat one-two with Jude Bellingham before cutting inside and slotting in a tidy finish, keeping up his run of form in front of goal.

Rodrygo scored Madrid's third three minutes after the restart, placing a low shot under the goalkeeper's legs to finish off a quick counter-attack.

However, both Benavidez and Garcia capitalised on some poor defending to get Alaves back in the contest and set up a grandstand finale.

Thankfully for Ancelotti on his milestone game, Madrid regained their composure to get over the line.

Data Debrief: Madrid close in on Barca record

It is now 39 games unbeaten for Madrid in LaLiga. They are just the second team in the history of the competition to have such a long unbeaten run, after Barcelona in 2018 (43 games).

Ancelotti, meanwhile, was able to celebrate his landmark match in the end. He is just the second coach in Madrid history to oversee 300 matches in charge, after Migue Munoz.

The Italian has won 216 games, drawing 45 times and losing on 39 occasions.