Motherwell set up a last-day decider for second place in the Scottish Premiership after they hung on for a 2-1 victory over Inverness.
- Related Content
John Sutton sent Motherwell on their way inside four minutes when he netted his 23rd goal of the season after some careless defending from Ross Draper led to him conceding a penalty.
The hosts were given another helping hand in the 31st minute when Inverness defender Gary Warren headed an Iain Vigurs corner into his own net.
Motherwell had pressed and harried Inverness in the first half but, with rain teeming down at Fir Park, they made heavy weather of the second half.
Graeme Shinnie pulled one back 10 minutes in when his weak effort beat Lee Hollis and Motherwell sat off for the remainder of the game to make it an excruciating countdown for the vast majority of the 4,482 fans.
And their dream of consecutive runners-up finishes almost ended with almost the final kick of the ball when Billy McKay latched on to a long ball and steered the ball past Hollis, but his shot bounced off the inside of the post and Motherwell desperately cleared.
Motherwell's sixth season in European competition in seven years was assured when Dundee United lost against Aberdeen 24 hours earlier.
But the result from Tannadice also meant Motherwell had to get three points to have any realistic chance of leapfrogging the Dons, who they have to beat at Pittodrie on Sunday.
As well as the prestige, the difference between second and third is £240,000 in prize money and an extra fortnight's rest with the lower finishers starting their Europa League qualifying campaign on July 3.
Motherwell manager Stuart McCall appeared to have ordered his men to press Inverness high up the park and the tactics paid off inside four minutes.
Draper made a mess of an attempt to shepherd the ball out for a goal-kick inside the penalty box and tripped Sutton after the striker had nicked the ball off his toes.
The Englishman sent Dean Brill the wrong way from the spot to ease the home nerves.
Zaine Francis-Angol shot over from 20 yards as Motherwell continued to move forward but Caley Thistle were attacking with purpose too and Aaron Doran sent a curling shot just past the top corner from a difficult angle.
Hollis saved Carl Tremarco's header but Inverness shot themselves in the foot again.
Vigurs curled in a corner from the right which Sutton just missed at the near post but his marker did the job for him as the ball bounced off the head of Warren and past Brill before he had time to react.
Keith Lasley headed just wide at the other end but the Motherwell skipper's intervention stopped McKay from getting a free chance.
Motherwell finished the half playing some sharp, incisive passes inside the final third, the high point of which saw Lionel Ainsworth shoot against the underside of the bar from 14 yards after a square ball from Francis-Angol.
However, Motherwell did not resume as they had finished and the visitors soon got a goal back.
Shinnie got away from Craig Reid in the middle of the Motherwell half and ran towards the edge of the box before scuffing a right-footed shot from 20 yards. Hollis appeared to be deceived either by a bobble or a deflection and the ball trundled past his left foot into the middle of the goal.
McCall took off James McFadden and brought on Fraser Kerr at right-back with Reid moving into a five-man midfield.
Inverness remained on top and Greg Tansey had a long-range shot saved before sending in a free-kick that Danny Devine headed just wide from close range.
Caley Thistle continued to dominate possession and Motherwell struggled to get out of their own half.
Hollis saved Tansey's driven free-kick with his feet in the 85th minute as the home fans grew even more anxious.
Motherwell went down to 10 men when substitute Craig Moore limped off badly hurt as the 90 minutes ticked down and the hosts had a huge escape when McKay hit the post.