Celtic and Porto were both eliminated from the Champions League on a night of third qualifying round upsets.
Romanian side CFR Cluj twice came from behind to claim a sensational 4-3 win at Celtic.
The visitors led at half-time thanks to Ciprian Deac's towering header but the Hoops made a storming start to the second half to go 2-1 ahead through goals from James Forrest and Odsonne Edouard.
Scott Brown's handball allowed Billel Omrani to net from the spot however and though Ryan Christie soon put Celtic back in front, Omrani quickly levelled again on the rebound in the 80th minute to put the Romanians ahead on away goals.
George Tucudean then netted with the last kick of the game to seal a 5-4 aggregate win.
Celtic will face Sherrif of Moldova or Sweden's AIK in the Europa League play-off round.
Celtic manager Neil Lennon admitted they had shot themselves in the foot with their first-half display.
Lennon said: "The first half we were so passive, no tempo, I don't know where that came from. We weren't physical or aggressive enough and certainly didn't work hard enough to stop crosses, second balls.
"We got a warning beforehand and didn't stop the cross and then we do the exact same thing again.
"At half-time we got after them a little bit and got the right response but we shot ourselves in the foot with the goals we conceded. We had the lead twice and we have given it away."
Two-time European champions Porto went out on the away goals rule after losing 3-2 at home to FK Krasnodar.
The Russians went 3-0 up on the night through Magomed Suleymanov (two) and Tonny Vilhena and second-half strikes from Ze Luis and Luis Diaz could not save Porto.
Krasnodar, who were only founded in 2008, will play Olympiacos for a place in the group stages.
Ajax, semi-finalists last season, survived a nervous evening to beat PAOK 3-2 for a 5-4 overall success.
The Greeks went ahead through Diego Biseswar (23) but Dusan Tadic equalised from the spot two minutes before the break.
Nicolas Tagliafico (79) put Ajax ahead and Tadic (85) converted his second penalty before Biseswar struck again deep in stoppage time to leave the Dutch champions hanging on.
Red Star Belgrade beat FC Copenhagen 7-6 on penalties after the sides had drawn 1-1 for the second time, Dame N'Doye having cancelled out Richmond Boakye's early effort for the Serbian champions.
Club Brugge shared a six-goal thriller with Dynamo Kiev to go through 4-3 on aggregate.
Both sides were reduced to 10 men and Kiev were given hope when Brandon Mechele put through his own net in stoppage time.
But substitute Lois Openda eased Brugge's nerves moments later to make it 3-3 on the night.
Brugge's next opponents will be LASK Linz after the Austrians beat Basel 3-1 for a 5-2 aggregate victory.
Second-half goals from Ruben Semedo and Mathieu Valbuena (penalty) gave Olympiakos a 3-0 overall victory over Istanbul Basaksehir.
Rosenborg repeated their 3-1 first-leg success over Slovenian side NK Maribor to set up a tie with Dinamo Zagreb, who thrashed Ferencvarosi 4-0 in Hungary to win 5-1 on aggregate.
APOEL overturned a first-leg deficit to shock Dundalk's conquerors FK Qarabag 2-0 in Azerbaijan and win 3-2 on aggregate.