Gareth Bale came off the bench to score a late winner as Real Madrid avoided embarrassment in a 2-1 victory over Al Jazira in the Club World Cup semi-finals.
Bale, making just his second appearance since September, found the net with his first touch on a frustrating outing for Madrid, who dominated possession but struggled to find a way through.
An inspired display by Al Jazira goalkeeper Ali Khaseifa thwarted the European champions early on before Romarinho fired the Emirati outfit into an unlikely lead.
Real Madrid had seen two goals disallowed in the first half and Al Jazira were themselves denied by VAR early in the second, with Mbark Boussoufa having an effort chalked off for offside.
Khaseif's withdrawal through injury after 51 minutes sparked the beginning of the Madrid revival, with Ronaldo becoming the competition's all-time top scorer with his sixth Club World Cup goal before Bale completed the turnaround in the 81st minute.
Madrid will now face Gremio in the final in Abu Dhabi on Saturday.
1 - Gareth Bale has scored with his first shot and his first touch of the game against Al Jazira. Impact. pic.twitter.com/8LvLjLBVZ9
-- OptaJose (@OptaJose) December 13, 2017
Al Jazira goalkeeper Khaseif was predictably kept busy in the early stages and was equal to everything Madrid threw at him.
Two dangerous Ronaldo headers - the deflected second requiring a miraculous reaction save - were kept out by the 30-year-old, while a fierce Luka Modric drive that looked destined for the bottom-left corner was touched onto the post.
Khaseif's all-action opening looked to have taken its toll when he went down injured after 14 minutes, but he was soon back on his feet and springing left to deny Karim Benzema.
Benzema should have done better when he sent another header flying over the crossbar with the goal at his mercy moments later, and Khaseif continued to frustrate Madrid, getting down brilliantly to keep out Modric before Ronaldo sent yet another header straight at him.
Al Jazira attacks were rare, however, and Ali Mabkhout squandered the side's first clear-cut chance by firing wide of the left-hand post.
Benzema finally had the ball in the net after 24 minutes but had his effort ruled out for a Ronaldo shove on Mohamed Ayed, before the France international was himself guilty of costing his side a goal.
Casemiro's header deflected in off a defender to spark Madrid celebrations - but a video review swiftly dampened spirits by judging Benzema to be offside.
And Al Jazira took a shock lead four minutes from half-time, when some lax defending from an underemployed Madrid back line allowed Romarinho to turn inside Raphael Varane and coolly curl around Keylor Navas.
The match looked to have taken another remarkable turn early in the second half but Al Jazira's hopes soon began to unravel.
Boussoufa appeared to have doubled Al Jazira's lead only to be deemed marginally offside after he and Mabkhout had raced clear of an absent Madrid defence.
And an even bigger blow arrived three minutes later when Khaseif's earlier injury forced him off.
Having toiled for an hour trying to get the better of game's star performer, it took just three minutes to beat replacement Khaled Al Senaani - Ronaldo turning in the box and rifling home the leveller.
Al Senaani was on hand to block a Benzema strike as Madrid chased the lead, before the striker's next two efforts bounced off the left-hand upright.
RECORD-BREAKER!-- #ClubWC (@FIFAcom) December 13, 2017
With @Cristiano levelling the scores in Abu Dhabi, the @RealMadrid man becomes the # ClubWC 's all-time top scorer, registering his sixth goal in the competition! pic.twitter.com/0hzU5QijsZ
While Madrid controlled possession and continued to turn the screw, they repeatedly looked vulnerable at the back whenever Al Jazira ventured forwards.
However, Bale's introduction took less than a minute to have a decisive impact on the match, as the Wales international converted from a Lucas Vazquez cutback to find the net with the slightest hint of a deflection from Ronaldo.