Cristiano Ronaldo scored the 50th hat-trick of his career as Real Madrid beat Girona to move up to third in La Liga.
Ronaldo converted Toni Kroos’ pass, but Cristhian Stuani’s header made it 1-1.
Real retook the lead with a powerful strike from Ronaldo and he then set up Lucas Vazquez for the hosts’ third before completing his hat-trick.
Stuani headed in Girona’s second, Gareth Bale scored Real’s fifth, Juanpe pulled one back but Ronaldo got his fourth and Real’s sixth in injury time.
The result takes Real, Spanish champions last season, above Valencia but they are still four points behind city rivals Atletico, who fell to a surprise 2-1 loss at Villarreal.
Real are still 15 points behind leaders Barcelona, who won 2-0 at home to Athletic Bilbao earlier on Sunday.
How the goals went in
1-0, Ronaldo (10 mins): Real Madrid played a short corner, with Toni Kroos and Marcelo working the training ground routine. Kroos spotted the movement of Ronaldo, who slotted in a first-time finish into the far side of the net.
1-1, Stuani (29 mins): Dani Carvajal gave a needless free-kick and Alex Granell’s set piece was met by former Middlesbrough striker Stuani, who powered a header past Keylor Navas.
2-1, Ronaldo (48 mins): Karim Benzema played a through ball to Ronaldo, who ran on to it and smashed a first-time shot, which went in off the underside of the crossbar.
3-1, Vazquez (58 mins): A lovely team move involving Marcelo, Benzema and Ronaldo ended with the Portuguese setting up Vazquez and he finished into the bottom corner.
4-1, Ronaldo (64 mins): Ronaldo completed the 50th hat-trick for club and country in his career when he steered in the rebound after Benzema’s effort had been pushed away by goalkeeper Yassine Bounou.
4-2, Stuani (68 mins): Stuani bagged his second of the game, outmuscling Dani Carvajal at the back post to head in his second goal.
5-2, Bale (86 mins): Two former Tottenham players combined as Luka Modric played the ball through to substitute Gareth Bale and the Welshman beat the offside trap and clipped a lovely finish past Bounou.
5-3, Juanpe (89 mins): Girona defender Juanpe was left unmarked six yards out and he headed in Girona’s third.
6-3, Ronaldo (91 mins): Ronaldo had the final say as he finished from 12 yards from Kroos’ pass for his fourth of the game and Real’s sixth.