Linfield progressed to a play-off for the Europa League group stages by beating 10-man FK Sutjeska 3-2 at Windsor Park and 5-3 on aggregate.
The Irish Premiership champions will face Azerbaijan champions Qarabag.
Mark Stafford headed Linfield into an early lead but Bojan Bozovic levelled, before Shayne Lavery scored a brilliant goal after a goalkeeping error.
Alexsandar Sofranac was sent off but Bozovic headed in after the break and then Matthew Clarke tapped in.
The victory sees Linfield make it through back-to-back rounds in Europe for the first time since 1966 when they reached the European Cup quarter-finals.
The Blues become the first Irish League side to make the Europa League play-offs where they will face Qarabag who lost 3-2 on aggregate to Cypriots Apoel Nicosia in the third qualifying round of the Champions League.
Linfield are assured of almost £1.4m in Uefa prize money by reaching the next stage of the competition but face formidable opposition in the form of Qarabag, who defeated League of Ireland champions Dundalk 4-1 on aggregate in the Champions League second qualifying round.
Linfield will have home advantage for the first leg on Thursday 22 August, with the second leg away from home a week later.
A place in the Europa League group stages would net in the region of £4m for the south Belfast club.
Linfield manager David Healy kept faith with the starting line-up which secured a memorable 2-1 victory in the away leg of their third-round-qualifier last week and the hosts soon extended their advantage with a seventh-minute goal from Stafford.
The defender rose high and in between two Sutjeska defenders to score with a header from six yards out after meeting Kirk Millar’s corner from the left.
The visitors were level eight minutes later when Bozovic flicked a backward header past Rohan Ferguson from Damir Kojasevic’s floated left-foot free-kick.
Lavery restored the hosts’ lead with a fine individual predatory goal, showing skill and awareness to pick up the loose ball and rifle home from 25 yards after under-pressure goalkeeper Vlado Giljen made a mess of an attempted clearance.
Lavery was a constant thorn in the side of the Montenegrins with his trickery and pace and defender Aleksandar Sofranac received a second yellow card from Czech referee Miroslav Zelinka for a foul on the former Everton player 10 minutes before the break.
Millar, who scored both goals in the first leg, headed wide from a Clarke cross before the break as livewire Lavery continued to torment the Sutjeska defence.
Bozovic breathed life into the visitors’ hopes with a glancing near-post header from a corner just after the hour mark but substitute Joel Cooper made space for himself to provide the cross for Clarke to find the net with a simple finish from close range after 76.
Linfield manager David Healy: “I’m thrilled for the players and the club to be given the opportunity to go next week and perform in a big tie for the club.
“It will be a tough one but the way we are playing at the minute we will relish the challenge.
“Everything we are asking of the players they are delivering and everyone in the dressing room is excited and looking forward to the challenge in Qarabag.”
- 14LaverySubstituted forWaterworthat 79′minutes
- 12MillarSubstituted forCooperat 67′minutes
- 31QuinnSubstituted forStewartat 76′minutes
- 23McGivernBooked at 40mins
- 6NedicBooked at 64mins
- 77VlaisavljevicSubstituted forVucicat 63′minutes
- 11ErakovicSubstituted forNikolicat 85′minutes
- 15SofranacBooked at 36mins
- 19BozovicBooked at 51minsSubstituted forMarkovicat 73′minutes
- Miroslav Zelinka