Max Meyer secured Schalke's progression to the last 16 of the Champions League as his goal sealed a 1-0 win at Maribor in Group G on Wednesday night.
The Bundesliga side needed a victory over Maribor and for group leaders Chelsea to beat Sporting Lisbon in the group's other game to progress.
The group was in the balance, however, as a win for Maribor would see the Portuguese club go through.
Meyer scored the decisive goal in the 62nd minute to set up a nervy last half hour at Stadion Ljudski vrt, as with Chelsea leading Sporting 3-1 at Stamford Bridge, all Schalke needed to do was hold on to claim second place in the group.
With everything to play for, both sides set their stalls out to attack, although find the target proved to be elusive in the first half.
Agim Ibraimi sent a shot over the bar for Maribor in the 12th minute before Marcos Tavares took a chance from 30 yards, with Schalke goalkeeper Ralf Fahrmann making a good catch.
Tranquillo Barnetta headed a chance wide for the German side with Tavares again denied, this time from the six-yard box, by a block from Atsuto Uchida.
Both sides were struggling to find the target and make their chances count, with Roman Neustadter the next man to send a shot awry when his strike from distance flew over the bar.
Maribor midfielder Sintayehu Sallalich forced a save from Fahrmann from 25 yards, with opposite number Jasmin Handanovic on hand to save a 35th minute header from Eric Maxim Choupo-Moting.
Ibraimi saw a chance caught by the Schalke stopper shortly before the break as the match remained goalless at half-time.
The breakthrough finally came for the visitors just after the hour mark when Meyer slotted a low strike past Handanovic to give Schalke the lead, which, with Chelsea comfortably beating Sporting at the stage, looked enough to put them through.
All it needed was for the German side to hold on to their one goal lead to progress to the knockout stages, which they managed despite a late flurry of off-target attempts by Maribor.