Cristiano Ronaldo scored a hat-trick as Real Madrid survived a major scare to beat Kashima Antlers 4-2 after extra time in a magnificent Club World Cup final.
Karim Benzema had put Madrid ahead after nine minutes, but the Japanese side stunned the Spanish giants when Gaku Shibasaki scored either side of half-time to turn the match on its head.
Ronaldo's penalty sent the game to extra time, where he scored twice more to ensure Madrid won the world title in Yokohama.
The trophy is Madrid's second Club World Cup success and the fifth time they have been crowned world champions, with head coach Zinedine Zidane celebrating his third trophy of the calendar year.
Kashima had won three matches en route to the final and they produced a superb performance, testing Madrid to the limit in front of a passionate crowd.
The opener arrived early after Lucas Vazquez's cross had been cleared as far as Luka Modric. The midfielder's volley was spilled by goalkeeper Hitoshi Sogahata into the path of Benzema and he converted the rebound with an instinctive finish.
Kashima captain Mitsuo Ogasawara fired just over with a blistering effort as the J.League champions attempted to draw level, although Sogahata soon had to get down sharply to save Benzema's long-range drive.
The equaliser arrived a minute before half-time when Shoma Doi crossed from the left to find Shibasaki, who forced his way past Raphael Varane in the penalty area and powered a finish into the bottom corner.
Incredibly, Kashima moved in front after 52 minutes when Sergio Ramos' poor clearance only travelled as far as Shibasaki. The midfielder escaped the attention of three Madrid players and fired a left-footed shot past Keylor Navas from 20 yards.
That rallied Madrid and Zidane's men equalised from the penalty spot after a combination of Shibasaki and Shuto Yamamoto brought down Vazquez, with Ronaldo firing into the bottom corner from 12 yards.
Madrid were quickly seeking a winner and Ronaldo had a shot saved by Sogahata, while Ramos lashed an attempt over from the resulting corner.
Marcelo was the next to be denied by Sogahata, while Yasushi Endo briefly stemmed the flow of attacks by forcing Navas into action at the other end.
But Ronaldo had a goal ruled out for offside after Benzema's shot had been parried by the Kashima keeper, before the Portugal international headed Vazquez's cross over.
Ronaldo squandered another chance when he failed to beat Sogahata having been sent through on goal by Benzema, and the Frenchman headed off target from close range.
A thrilling contest moved towards extra time after Madrid survived three late scares, with Navas having to save from Fabricio and Mu Kanazaki, while Ramos avoided a second yellow card for a last-minute foul.
Ronaldo struck twice in extra-time, first firing in a left-footed finish after 98 minutes having broken the offside trap to latch on to Benzema's pass.
Yuma Suzuki headed against the crossbar for Kashima as an extraordinary match continued to hang in the balance until Ronaldo sealed the trophy by collecting Toni Kroos' scuffed shot and powerfully striking into the roof of the net.
Madrid almost had a fifth when, after a weaving run, substitute Alvaro Morata's shot beat Sogahata but was cleared off the line by Naomichi Ueda, with Ronaldo and Madrid celebrating a memorable victory.