The Spanish side led 2-0 from the first leg last week, but were given an almighty scare by Schalke, who led three times on the night.
Schalke regained the lead late in the first period when Klaas-Jan Huntelaar fired home from close range, but again Real Madrid responded as Ronaldo netted his second header of the match in first-half stoppage time.
Huntelaar scored his second late on to send Schalke 4-3 ahead on the night, but the German side could not find another as Real Madrid advanced 5-4 on aggregate.
Here, Sports Mole dissects the 90 minutes of action in Madrid.
On target: 9
On target: 10
Was the result fair?
Where on earth to start? This was one of the all-time classic Champions League matches and it almost produced one of the all-time shocks. It was supposed to be a comfortable and indeed straightforward evening for Real Madrid, with their two-goal lead from the first leg placing them in a strong position. Schalke had not read the script, however, and produced one of their best European performances in recent memory. There is no doubt that the visitors deserved to take the lead after 20 minutes and they were unfortunate to concede straight after to Ronaldo, who pulled his team through in the first period.
Schalke led 2-1 five minutes before the break, but again Ronaldo came up trumps to put Real Madrid on terms for the night and two goals ahead on aggregate. The game's fifth goal was always going to be vital and when it came for the hosts, Schalke's challenge looked dead and buried for another season. The Germans found a second wind late on, however, and set up a grandstand finish courtesy of a super effort from the impressive Huntelaar, who would have enjoyed his return to Madrid.
In truth, there is little doubting that Schalke deserved to emerge victorious on the night. They were quicker and stronger than Real Madrid for long spells of the match, but they just could not contain Ronaldo down the other end. Real Madrid were very good in Germany and might argue that their first-leg performance meant that they just deserved to make the quarters, but Schalke were the better team in this one, of that there is little doubt. It is a European match that will certainly live long in the memory.
Real Madrid's performance
Regular watchers of Real Madrid in recent weeks will not have been too surprised with their start to the match. It was laboured and slow, and directly reflected their struggles over the last few matches. As touched upon, Schalke deservedly took the lead after 20 minutes courtesy of some poor defending, but Ronaldo's first five minutes later changed the complexion of the tie. As it turned out, Schalke won on the night, but Real Madrid's quick response to falling behind on two separate occasions just allowed them to keep the visitors at arm's length. Ronaldo's performances have been called into question in recent weeks, but the Portuguese answered his critics in spectacular fashion. Had it not been for the best player in the world, Los Blancos might be out of the Champions League. Their overall performance was so disappointing.
At the back, they were simply all over the place. Sergio Ramos's absence has hurt them, while Carlo Ancelotti took the surprising decision to omit Dani Carvajal and Marcelo from his XI and their replacements, Fabio Coentrao and Alvaro Arbeloa, had poor nights. Sami Khedira struggled in midfield, while it was another off-night for Gareth Bale, who is going through a tough time at the moment. Ronaldo's heroics proved just enough, but the lack of cohesion between their defence and midfield will have worried the supporters, especially at this stage of the season. They will be in the draw for the quarter-finals, but their expected challengers in the prestigious competition will not be worried by what they have seen recently.
In truth, not many gave Schalke a prayer in the second leg. It was supposed to be the evening where Real Madrid set a record for consecutive wins in the Champions League, but football is rarely straightforward, especially at this level. Without going over old ground, Schalke deserve such praise for their performance. In many ways, they did not have much of a choice due to their standing in the tie, but it still takes a lot to attack Real Madrid at the Bernabeu. Their problem, however, stemmed from being unable to keep hold of the lead for longer than five minutes on two separate occasions. It had been thought that the third for Real Madrid would kill their challenge, but goals from Sane and Huntelaar moved the German outfit ahead.
In the end, it just was not enough, but their progress over the last 12 months has been excellent. They were beaten 9-2 on aggregate by Real Madrid at the same stage last season, but gave the holders a real run for their money this time around. As mentioned, Huntelaar was excellent in attack, but mentions must also be given to Max Meyer and Sane, who were both fantastic in the final third of the field. Like Real Madrid, some of Schalke's defending was a little suspect and to be blunt, that probably cost them the chance to make it through. It is difficult to be critical of the German side, however, as they came close to becoming the first team to overturn a 2-0 defeat from the home leg of a Champions League knockout tie.
Sports Mole's man of the match
Klaas-Jan Huntelaar: Ronaldo is a shade unfortunate to miss out here after almost single-handedly saving his team, but Huntelaar's efforts must be recognised. The Dutchman entered the match on the back of a long scoring drought in the competition, but scored two excellent goals. His first was a typical Huntelaar strike from close range, but his second was a sensational effort via the crossbar. The experienced attacker gave the Real Madrid defence nightmares, with his movement and ability to hold possession contributing to Schalke's excellent performance. He remains one of the world's deadliest strikers.
It is difficult to pin-point one moment, such was the number of mistakes on show. Real Madrid's Iker Casillas might have done better with three of Schalke's four goals, but their defending as a whole was unforgivable. The worst moment came in the build-up to Schalke's first, when Arbeloa simply allowed Fuchs time and space to drift into the box. Arbeloa was also at fault for Schalke's second, while Coentrao on the opposite flank had a bit of a stinker. Varane also almost cost his team with a poor back-pass in the first period on what was a terrible night for Real Madrid's back four. Improvement is needed.
Referees are not often given much credit, but Damir Skomina deserves a big pat on the back. The 38-year-old issued just three yellow cards during the enthralling affair and certainly contributed to the end-to-end nature of the match. Other referees might have been picky in certain situations, but Skomina was more than prepared to allow things to develop. It was a really strong performance from the man in the middle.
Real Madrid: Los Blancos will attempt to return to winning ways in La Liga when they host Levante on Sunday evening.
Schalke: The German outfit also return to domestic action this weekend, facing a trip to struggling Hertha Berlin on Saturday afternoon.