Jordan White's double ensured Inverness claimed first blood in the opening leg of their Ladbrokes Premiership play-off quarter with a 3-1 win over Ayr.
Dundee United await the winners next week and it is John Robertson's side who will feel they are half way there after a hard-fought triumph at Somerset Park.
Charlie Trafford and White put Caley Thistle two up early in the second half before Coventry-bound defender Michael Rose pulled one back for the Honest Men.
But a White penalty means Inverness will take a two-goal advantage into Saturday's second leg at the Caledonian Stadium.
A stunning first half of the campaign saw Ian McCall's side emerge as the dark horses of the promotion race but their impressive early form quickly tailed off by the time they reached December and they would pick up just five more wins by the time they trudged home in fourth place.
Their Highland opponents by contrast won six and drew two of their final 10 games to edge into third and it was clear they were the side with momentum early on.
Yet the first half was grim stuff as neither side looked comfortable getting the ball down on the bobbly Somerset surface.
The opener after 33 minutes came about from the only real moment of quality as Joe Chalmers flighted a perfect corner for the unmarked Trafford to thud home a header.
Ayr should have levelled three minutes later as Michael Moffat's clever dummy fooled the Caley Thistle back-line but Declan McDaid's strike soared over Mark Ridgers' goal.
The next goal was going to be crucial and it went to the visitors six minutes after the change of ends.
Liam Smith missed the chance to clear his lines and Aaron Doran took his chance to steal as he bundled his way into the box. The ball spilled to White but Inverness' top-scorer kept his calm as he dinked the ball over Ross Doohan for the second.
Ayr knew the tie was slipping away from them and redoubled their efforts.
Ridgers had to palm away a free-kick piledriver from Lawrence Shankland but the resulting corner delivered a lifeline as Rose's header from substitute Luke McCowan's set-piece crashed into the net.
But Declan McDaid's penalty box push on Liam Polworth with 14 minutes left put the brakes on their fightback as referee Alan Muir pointed to the spot. White fired his penalty into the postage-stamp corner to leave Inverness with one foot in the semis.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Andy Newport, Press Association Sport');
ga('pacontentapi.set', 'dimension2', 'f076b874-a4b3-4501-8788-1cc7e7735b6a');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Jordan White puts Inverness in control against Ayr'});