Legia scored six and Celtic managed four while Ludogorets and Salzburg also recorded big wins as the final ten teams booked places in the third qualifying round.
Article top media content
Second qualifying round deciders (click for details)
Celtic 4-0 Linfield (agg: 6-0)
Dudelange 0-1 APOEL (agg: 0-2)
Honvéd 2-3 Hapoel Beer-Sheva (agg: 3-5)
København 1-2 Žilina (agg: 4-3)
Kukës 2-1 Sheriff (agg: 2-2; Sheriff win on away goals)
Legia 6-0 Mariehamn (agg: 9-0)
Ludogorets 4-1 Žalgiris (agg: 5-3)
Maribor 1-1 Zrinjski (agg: 3-2)
Rosenborg 2-1 Dundalk (aet) (agg: 3-2)
Salzburg 3-0 Hibernians (agg: 6-0)
Rosenborg and København both had to survive big scares to reach the third qualifying round. Norwegian champions Rosenborg were taken to extra time by Dundalk before Matthías Vilhjálmsson's 98th-minute winner while København lost 2-1 at home to Žilina, squeezing through 4-3 on aggregate only after substitute Ramil Sheydaev missed a gilt-edged last-gasp chance for the visitors.
In contrast Salzburg and Ludogorets triumphed by three-goal margins to complete comfortable aggregate victories while Celtic beat Linfield 4-0 and Legia put six past Finland's Mariehamn. The tie of the night came in Hungary, where Honvéd rallied from 2-0 down to draw level against Hapoel Beer-Sheva, only for Anthony Nwakaeme's solo strike to give the Israeli champions a 5-3 aggregate success.
Alashkert 1-3 BATE (agg: 2-4)
Astana 1-1 Spartaks Jūrmala (agg: 2-1)
Budućnost Podgorica 0-0 Partizan (agg: 0-2)
Samtredia 0-1 Qarabağ (agg: 0-6)
TNS 1-5 Rijeka (agg: 1-7)
Vardar 3-1 Malmö (agg: 4-2)
Víkingur 0-2 FH Hafnarfjördur (agg: 1-3)
Vardar pulled off the shock of the night by eliminating Malmö, group stage participants in 2015/16. Trailing to an early Markus Rosenberg penalty, the Macedonian team registered a memorable victory with the aid of three unanswered second-half goals.
BATE also came from behind to progress, Mikhail Gordeichuk on target twice before the break against Alashkert, while a double from substitute Mario Gavranović helped Rijeka to a thumping win at TNS. The remaining ten second qualifying round ties conclude on Wednesday.
FCSB (ROU) v Viktoria Plzeň (CZE)
Nice (FRA) v Ajax (NED)
Dynamo Kyiv (UKR) v Young Boys (SUI)
AEK Athens (GRE) v CSKA Moskva (RUS)
Club Brugge (BEL) v İstanbul Başakşehir (TUR)
Slavia Praha (CZE) v BATE Borisov (BLR)
Astana (KAZ) v Legia Warszawa (POL)
Maribor (SVN) v FH Hafnarfjördur (ISL)
København (DEN) v Vardar (MKD)
Celtic (SCO) v Rosenborg (NOR)
Hapoel Beer-Sheva (ISR) v Ludogorets (BUL)
Viitorul (ROU) v APOEL (CYP)
Salzburg (AUT) v Rijeka (CRO)
Qarabağ (AZE) v Sheriff (MDA)
Partizan (SRB) v Olympiacos (GRE)