Burnley edged through to the next round of the Europa League, but only after a tense extra-time victory over Scottish Premiership runners-up Aberdeen.
Jack Cork's header and an Ashley Barnes penalty - both in the additional half-hour - saw the Premier League side through to face Istanbul Basaksehir.
Chris Wood had put Burnley 2-1 ahead on aggregate with an early strike.
But a competitive Aberdeen levelled just before the half hour through Lewis Ferguson's stunning overhead kick.
Goalkeeper Joe Lewis made fabulous saves from Barnes and Sam Vokes - tipping the Welshman's header on to the bar - to force the tie into extra time.
But Cork's effort from a Charlie Taylor delivery, and Barnes' spot-kick after Scott McKenna was adjudged to have handled a Johann Berg Gudmundsson cross, ensured Burnley will face Turkish opposition in the third qualifying round.
The first leg will be played next Thursday, with the return seven days later to decide who will advance to the play-off round.
- Burnley boss Dyche happy to provide 'European tour' after beating Aberdeen
- Reaction & as it happened
- Listen: Sportsound podcast
- Aberdeen players have 'no right' to be down
An early payout & a stunning rebuttal
Aberdeen manager Derek McInnes said he had no interest in leaving Lancashire with his side as gallant losers. The odds may have been stacked against the visitors but they ran out, on a stunning summer night, quietly confident they could upset the odds.
Burnley knew that if they could keep a clean sheet, they would progress, but boss Sean Dyche decided to partner Wood and Vokes up front in a bid to force the issue. It took just six minutes for the decision to pay off.
After a starting with a tempo that was clearly missing at Pittodrie, Wood latched on to a long, defence-splitting ball through the middle, and with Lewis all at sea, the striker remained patient before lashing the ball high into the net from eight yards.
Any Burnley nerves were settled instantly and they found an assured rhythm that left Aberdeen chasing late evening shadows.
But McInnes' side finally started to creep into the game. Gary Mackay-Steven and Niall McGinn found space down either side and, when their impetus was rewarded just before the half-hour mark, it was simply stunning.
Burnley's attempt to clear a Mackay-Steven's corner looked lazy and when the ball broke to Ferguson at the edge of a packed six-yard box, he executed a stunning overhead scissors-kick.
The travelling support packed into a small section of the Cricket Ground End erupted as the 18-year-old wheeled away in an attempt to grasp what he had just done. Find a clip of it - it's worth watching.
The goal gave Aberdeen bags of confidence and, after Italian referee Massimiliano Irrati waved away claims for a red card when McKenna appeared to bring down a goal-bound Wood, Lindegaard saved a low Shinnie shot that was destined for the net.
Splendid goalkeeping & late drama
Burnley started the second half like they did the first, with Lewis denying Gudmundsson. But the Premier League side were now pouring forward, roared on by the Turf Moor faithful who suddenly realised they might have a part to play.
The incessant pressure was occasionally punctuated by the odd Aberdeen foray over the halfway line. Shinnie should have done better but blasted high over from a fine McGinn cut-back as the game continued to stretch.
At the other end, Lewis pulled off a save from Barnes that he may never better for the rest of his career. Barnes - on for Wood at the break - looked certain to score but Lewis diverted the ball over the bar with an outstretched arm.
As the contest swung from end to end, Lindegaard denied Shinnie again at his near post and Lewis got his fingers to a looping Vokes header that looked goal-bound all the way. It was breathtaking entertainment that was to spill into extra time.
With both sets of players looking fatigued, the pace slowed, but midway through the first period Burnley took the lead. Taylor's inch-perfect cross from the left was met perfectly by the head of Cork and Lewis knew his net would bulge before the ball even crossed the line.
Barnes sealed it from the spot and, at last, the home fans could relax. A victory for Burnley in their first home European tie in 51 years, just about deserved but Aberdeen travel north with their heads held high.
- 2LowtonBooked at 85mins
- 23WardSubstituted forTaylorat 90'minutes
- 25LennonSubstituted forMcNeilat 87'minutes
- 18WestwoodSubstituted forHendrickat 105'minutes
- 7Berg GudmundssonBooked at 71mins
- 11WoodSubstituted forBarnesat 45'minutes
- 4ConsidineBooked at 76mins
- 28HobanSubstituted forBallat 88'minutes
- 3ShinnieBooked at 70mins
- 19FergusonSubstituted forForresterat 105'minutes
- 10McGinnSubstituted forWrightat 81'minutes
- 16CosgroveSubstituted forMayat 100'minutes
- Massimiliano Irrati
- Shots on Target