Schalke confirmed their place in the Champions League knockout phase with a 2-0 home win against 10-man FC Basel on Wednesday that saw them finish second in Group E behind Chelsea.
Goals after the break by Germany's Julian Draxler and a strange second from Cameroon defender Joel Matip put Schalke in the last 16 to ease the pressure on under-fire coach Jens Keller.
The 43-year-old has been told a decison on his future will be made over the winter break in the wake of the Royal Blues' erratic form this season.
Having been knocked out of the German Cup last week and trailing leaders Bayern Munich by 17 points in the Bundesliga, Keller would have been set for dismissal after a year in charge had Schalke failed to go through.
The Royal Blues had to win to go through, and they faced 10 men for just under an hour as FC Basel had centre-back Ivan Ivanov, who cleared an early shot off the line, sent off for holding back Schalke's Adam Szalai on 31 minutes.
The Hungarian striker had only just replaced captain Benedikt Hoewedes, who went off with a hamstring injury just approaching the half-hour mark.
Hoewedes was lucky not to be shown a red card, instead of the yellow he received, on 29 minutes, as he injured himself with a rugby-style tackle on Basel captain Marco Streller, who would have been clear on goal.
Schalke had the best chance of the first half though, as Jefferson Farfan's cross was cleared onto the crossbar by Basel defender Taulant Xhaka on 12 minutes.
The ball fell to Draxler, who squared it to 18-year-old Max Meyer, but his shot was cleared off the line by Ivanov.
The breakthrough Schalke desperately needed came on 50 minutes when Farfan swung in a cross and found Draxler unmarked at the far post to slam home his shot and give the Royal Blues the lead.
Schalke secured their passage to the knockout phase seven minutes later when their second goal arrived in bizarre fashion.
Replays showed that five Schalke players were offside as the ball came into the box from a Farfan free-kick, but the assistant referee did not raise his flag and Matip was left alone to slot past Basel goalkeeper Yann Sommer.
Basel coach Murat Yakin was left protesting incredulously on the sidelines, but the defeat means the Swiss champions finish third in the group and drop into the Europa League.
After reigning champions Bayern Munich and Bayer Leverkusen qualified on Tuesday, Schalke joined last season's runners-up Borussia Dortmund in progressing to the last 16 on Wednesday as all four Bundesliga sides progressed to the knockout phase.