Champions League title-holders Real Madrid survived a scare as they scraped into the quarterfinals 5-4 on aggregate despite a first home defeat in the tournament since April 2011.
Schalke striker Klaas-Jan Huntelaar struck twice to end his former club's 21-match unbeaten run at the Bernabeu in the competition but the German side could not force the goal in the last six minutes which would have taken them into the quarterfinals.
Unhappy fans waved white handkerchiefs to show their displeasure at the end and the 4-3 loss took the gloss off another record-breaking night for Cristiano Ronaldo.
The Portugal international twice equalised with first-half headers with the second, moments before half-time, taking him level with Lionel Messi as the Champions League's joint-highest scorer with 75.
Messi will get the chance to respond against Manchester City next week but Ronaldo was at least able to claim one outright record himself as his second took him beyond former Real hero Raul to become the player with the most goals in all European competitions (78).
His double strike papered over the cracks of some shambolic defending from the reigning champions which had seen Christian Fuchs and then Huntelaar give the visitors a real chance of turning around a 2-0 deficit from the first leg.
However, Ronaldo's second and Karim Benzema's 20th of the season just after the interval appeared to have taken the game well beyond Schalke's reach.
But youngster Leroy Sane, on only his ninth senior appearance, pulled one back with over half-an-hour to go and Huntelaar set up a grandstand finish.
Real goalkeeper Iker Casillas certainly had Ronaldo to thank after slack handling errors contributed to Schalke twice taking the lead.
First he was beaten at his near post by Fuchs after 20 minutes despite getting a good hand on the shot and then, after Ronaldo had nodded in Toni Kroos' corner, he could only push Max Meyer's shot into the path of Huntelaar.
But Schalke were not exempt from poor defending and Ronaldo was inexplicably given a free run from the edge of the area to head in Fabio Coentrao's cross on the stroke of half-time for his 41st of the season.
Benzema's lateral run across the penalty area saw him slot the ball inside Timon Wellenreuther's left-hand post in the 53rd minute to make it 3-2, but Sane, a 19-year-old first-half substitute, took full advantage of Real's defence standing off to curl one home from the edge of the area.
Huntelaar's second, racing through to beat Casillas, set up a nervy final six minutes which they only just survived.