Zeljeznicar 2 Metalurg Skopje 2 (agg 2-2): Visitors advance on away goals
The Bosnian hosts were favourites to progress after a scoreless draw in Macedonia in the first leg and they looked on track as they took a 2-0 lead early in the second half.
Marjan Radeski popped up to give the visitors hope just after the hour-mark and captain Mile Krstev struck in additional time to see his side through on away goals in Sarajevo.
It was a heartbreaking finish for Zeljeznicar, who had made a promising start when Metalurg Skopje defender Ninoslav Dodevski headed a set-piece past his own goalkeeper in the 16th minute.
When Rijad Bajic struck a second from the edge of the area just nine minutes after the break, Admir Adzem's men looked set to advance.
Radeski gave his side a glimmer of hope when he cut in from the left and fired into the top corner in the 62nd minute.
Krstev delivered when coach Srgjan Zaharievski needed him most with a last-gasp equaliser sending the away side through.