Ronaldo scored the equalizer from a 25-yard free-kick.

Cristiano Ronaldo scored a stunning hat-trick as Portugal snatched a 3-3 draw with Spain in a World Cup classic here Friday. Real Madrid star Ronaldo crashed in an 88th minute free-kick to snatch a point for Portugal after a second-half goal from Nacho put the Spaniards 3-2 ahead. Ronaldo's late equaliser capped a storming encounter which came after a chaotic few days which saw Spain coach Julen Lopetegui sacked and Fernando Hierro appointed as his replacement. Earlier, Ronaldo had twice put the European champions in front only for Diego Costa to bring Spain level on each occasion on a steamy night on Russia's Black Sea coast.

But then Ronaldo stepped up to send his free-kick from 25 yards up over the wall and into the net, as the Iberian neighbours settled for a point apiece in this Group B encounter.

It was a remarkable signal of intent from the current Ballon d'Or winner, who had never made a serious impact in any of his previous three World Cups, only managing to score one goal in each.

In one night the Real Madrid superstar doubled his World Cup finals goal tally, and made history by scoring at an eighth consecutive major tournament going back to Euro 2004, when he was still a teenager.

It was typical of the now 33-year-old to take the headlines after news from the Spain camp had dominated the build-up to this game.

The evening had started in style for Ronaldo, as he scored a fourth-minute penalty after going down in the box under a foul from Nacho, playing at right-back with Dani Carvajal not fit.

Trademark Costa

Hierro, who cut an animated figure as he stood on the touchline with his sleeves rolled up, must have wondered at that point what he had let himself in for.

Yet Spain responded well and had the better of the game, as they drew level for the first time in the 24th minute via a trademark piece of centre-forward play by Costa.

He left Pepe on the floor as the pair challenged for a high ball, before breaking into the box and planting a low shot into the bottom corner.

The Portugal players were furious that no foul was given as Costa led with his forearm into the challenge on Pepe, but the officials let the goal stand without feeling the need to call on the Video Assistant Referee.

Spain then thought they had taken the lead as Isco smashed in a shot that bounced down onto the line off the underside of the bar, yet this time goal-line technology showed it was not in.

With Andres Iniesta, Isco and David Silva pulling the strings, Spain were on top, but Portugal went back in front just as half-time approached.

Goncalo Guedes teed up his captain Ronaldo, whose shot from 20 yards was straight at David De Gea, but the Manchester United goalkeeper could only help it on its way.

It looked like Ronaldo's first-half efforts might be in vain, as Spain regrouped at the interval and drew level 10 minutes into the second half with a textbook set-piece counter.

A free-kick floated into the area was headed back across the face of goal by Sergio Busquets and Costa was there to turn it in. Three minutes after that, Nacho's glorious effort from 22 yards made it 3-2, his half-volley curling into the net off the left-hand post.

That looked to be that, but Ronaldo had the last word, and Morocco -- beaten 1-0 by Iran earlier on Friday -- will not look forward to facing him in their next game.