Motherwell were bundled out of Europa League qualifying by an extra-time goal from Stjarnan in Iceland.
Stevie Hammell headed the visitors in front and into a 3-2 aggregate lead, only for Olafur Finsen to level from the penalty spot.
Lionel Ainsworth volleyed the Scottish side back in front after the break but Rolf Toft lashed in a powerful strike with five minutes remaining.
And Stjarnan won the tie thanks to Atli Johannsson's effort on 113 minutes.
Motherwell, who led 2-0 at Fir Park before being pegged back in injury-time, will be hugely frustrated after twice going in front on their travels.
But it was a spectacular goal that settled a see-saw tie.
Motherwell forced a succession of early corners and the pressure paid off in the 12th minute when Hammell powered a header into the top corner from Ainsworth's delivery.
Keith Lasley came close from another corner when he fired just wide and Motherwell were looking comfortable, although Hammell had to throw himself in front of Toft's shot.
But Lasley was soon penalised by Greek referee Antonis Giachos, who ruled he had brought down Johansson as the Stjarnan player brushed into the midfielder's body before falling over.
Finsen, just as he did twice at Fir Park, converted the penalty.
Lasley, who conceded both penalties in the home leg, was determined to atone and almost did so on the stroke of half-time with a volley that was well-stopped by keeper Ingvar Jonsson.
Motherwell almost fell behind early in the second half but Dan Twardzik came off his line quickly to foil Toft.
But Stuart McCall's side came roaring back and Lasley came close again following another corner when his shot was deflected over.
Craig Reid's cross was then deflected on to the post and Ainsworth's delivery was just turned wide as Motherwell continued to press.
Stjarnan broke and Pablo Punyed shot wide just before Ainsworth put Motherwell ahead for the third time in the tie.
Josh Law, who scored twice in the first 19 minutes at Fir Park, sent in a delightful ball and Ainsworth crashed the ball home from close range.
McCall's men were relieved to see Hordur Arnason make a hash of a great chance after stealing in behind the visitors' defence before the manager made a tactical switch.
Knowing his side would at least get to extra-time unless Stjarnan scored twice, McCall brought on Fraser Kerr and Zaine Francis-Angol for Ainsworth and Law in the 74th minute for fresh legs and defensive strength.
However, Toft levelled with five minutes left as he shot into the top corner from the edge of the box.
Motherwell lost Stuart Carswell to injury early in extra time as Jack Leitch came on and Jonsson made a great double stop from Lasley and John Sutton, but the hosts then missed two good chances.
And Stjarnan, who are unbeaten in the league after 12 matches, won it with seven minutes left when Johansson fired a long-range volley in off the bar to set up a tie with Poland's Lech Poznan.