Second-half substitute Jan Blažek struck in the final minute of extra time to book FC Slovan Liberec's place in the UEFA Champions League third qualifying round and eliminate FC Shakhter Karagandy.
The Czech champions led 1-0 from last week's first leg but Zhambyl Kukeyev levelled the aggregate score with a coolly-taken spot kick five minutes before the break. Jiří Fleišman came close to an immediate response for the visitors only for his strike to go narrowly wide.
Slovan continued to attack after the break but it was not until the 80th minute that Josef Šural brought the best out of Aleksandr Mokin in the Shakhter goal. Andrei Finonchenko could have put the hosts ahead in the tie with six minutes remaining but failed to convert when one-on-one with David Bičík.
With the aggregate score level at 1-1 the game went into extra time and both sides looked to attack, with Finonchenko wasting another good opportunity to score a potentially decisive second. Miloš Bosančić then struck a post for the visitors before Blažek's strike from close range with just seconds remaining secured Slovan's place in the third qualifying round, where they will take on CFR 1907 Cluj.