Ronaldo equalised from the penalty spot before pouncing twice in extra time to give the Real their second world title in three years.
Cristiano Ronaldo smashed a hat-trick as Real Madrid survived a colossal scare to beat Japan's Kashima Antlers 4-2 and lift the Club World Cup on Sunday.
A Gaku Shibasaki double briefly threatened one of football's greatest ever shocks after Karim Benzema had given Real the early advantage in Yokohama.
But Ronaldo equalised from the penalty spot before pouncing twice in extra time to give the Spanish giants their second world title in three years, and fifth in total.
"Bloody hell, what a game!" said a breathless Ronaldo. "We had to suffer, but that's what finals are all about.
"People always expect more of Cristiano," he added, speaking of himself in the third person.
"It has been an unforgettable year -- winning the Champions League, the Super Cup and the Euros with Portugal.
"And to score three more goals and to have such a perfect end to this dream year, it's incredible."
The victory extended Real's club record unbeaten run to 37 matches in all competitions, while French coach Zinedine Zidane surpassed Fabio Capello's record for their best start to a season.
But the European champions, yet to be defeated in 26 games this campaign, were forced to dig deep by an Antlers side who finished third in the J-League before winning the championship final.
Benzema's toe-poked opener was cancelled out on the stroke of halftime by Shibasaki, who took advantage of some calamitous defending from Raphael Varane to lash in a sharp volley.
The Japan midfielder sparked wild celebrations among a crowd of 68,000 seven minutes after the break when he smashed home a left-foot shot from long distance.
Kashima's lead was short-lived, however, as Ronaldo levelled from the spot after Lucas Vazquez was bundled over by Shuto Yamamoto.
Ronaldo, who scooped his fourth Ballon d'Or last week, put Real back in front with a clinical finish eight minutes into extra time after a clever pass from Benzema.
And the Portuguese superstar completed his hat-trick -- the first in a Club World Cup final -- six minutes later with another poacher's strike to break Japanese hearts.
"The stats don't lie," said Ronaldo, who was also voted player of the tournament.
"I've had a spectacular season. People often criticise me but I'm used to it. I just carry on working on the pitch and get on with my job of winning titles."
European teams have now won the Club World Cup nine out of the last 10 years.
But Real rode their luck at times in a pulsating final, not least when Zambian referee Janny Sikazwe chose not to show captain Sergio Ramos a second yellow card late on for what appeared a cynical block.
"The referee lacked courage, which was regrettable," said Kashima coach Masatada Ishii.
"My players were brave, their attitude was great and I feel we have grown as a club through this tournament."
Zidane, who won club world titles as a player with Real in 2002 and Juventus in 1996, paid tribute to his players.
"Kashima surprised us a little with their speed and physicality," he said.
"But when we have struggled this season we have always believed in ourselves and found a way to win."