Match ends, Inverness CT 1, Motherwell 2.
Marvin Johnson's stoppage-time winner against Inverness Caledonian Thistle all but secured a top-six Scottish Premiership finish for Motherwell.
The winger ran from his own half to score a dramatic counter-attack goal.
Lionel Ainsworth's scooped shot evaded goalkeeper Owain Fon Williams and his defence to give Motherwell the lead.
Iain Vigurs converted a penalty to bring Inverness level after Keith Lasley's foul on Ross Draper but Johnson would have the last word.
Mark McGhee's Well - who move above St Johnstone into fourth - will be assured of a top-half place after the league splits in two later this month if Partick Thistle fail to beat Dundee United on Tuesday.
Both sides came into the game in the Highlands off the back of impressive wins and knocked the ball around with confidence early on.
They produced some neat passing moves but those were largely confined to the area between the respective penalty boxes with little creativity in the final third.
It took 24 minutes before either goalkeeper was forced into action when Carl Tremarco finally found space for a cross from the left that picked out Liam Hughes.
The former Cambridge United striker managed to loop a header on target but it was a comfortable save in the end for Connor Ripley - as it was just a few minutes later.
This time it was Miles Storey who provided the cross from the left with Hughes getting across his marker to glance a header that the visiting goalkeeper grabbed gratefully.
Storey himself should have done better when Motherwell were again opened up down the same flank in first-half stoppage time but he could only direct Andrea Mbuyi-Mutombo's cross wide from close range.
Motherwell's main threat came from the occasional set piece and Stevie Hammell's delivery caused problems for the Inverness defence but Chris Cadden guided the ball wide.
After a sterile opening hour, Fon Williams made a mess of gathering a cross and Louis Moult set up Ainsworth to lob in the opening goal.
The lead did not last long, however, as Lasley was penalised for taking down Draper and Vigurs scored against his former club from 12 yards.
However, Johnson raced away following an Inverness corner to fire past Fon Williams as time ran out.
- 25Fon Williams
- 6MeekingsSubstituted forHornerat 87'minutes
- 3TremarcoBooked at 41mins
- 8DraperBooked at 83mins
- 39StoreySubstituted forWilliamsat 85'minutes
- 21HughesSubstituted forWilliamsat 74'minutes
- 26CaddenSubstituted forAinsworthat 53'minutes
- 14LasleySubstituted forFletcherat 73'minutes
- 17GomisSubstituted forLeitchat 53'minutes
- 77McDonaldBooked at 90mins
- John Beaton
- Shots on Target
Second Half ends, Inverness CT 1, Motherwell 2.
Goal! Inverness CT 1, Motherwell 2. Marvin Johnson (Motherwell) left footed shot from outside the box to the centre of the goal.
Corner, Inverness CT. Conceded by Josh Law.
Scott McDonald (Motherwell) is shown the yellow card for a bad foul.
Ryan Williams (Inverness CT) wins a free kick in the attacking half.
Foul by Scott McDonald (Motherwell).
Ross Draper (Inverness CT) wins a free kick in the attacking half.
Foul by Louis Moult (Motherwell).
Substitution, Inverness CT. Lewis Horner replaces Josh Meekings because of an injury.
Attempt saved. Gary Warren (Inverness CT) header from the centre of the box is saved in the centre of the goal.
Substitution, Inverness CT. Ryan Williams replaces Miles Storey.
Foul by Andrea Mbuyi-Mutombo (Inverness CT).
Scott McDonald (Motherwell) wins a free kick in the attacking half.
Ross Draper (Inverness CT) is shown the yellow card for a bad foul.
Foul by Ross Draper (Inverness CT).
Marvin Johnson (Motherwell) wins a free kick in the attacking half.
Attempt saved. Andrea Mbuyi-Mutombo (Inverness CT) right footed shot from more than 35 yards is saved in the top centre of the goal.
Attempt missed. Iain Vigurs (Inverness CT) left footed shot from outside the box is too high.
Liam Polworth (Inverness CT) wins a free kick in the defensive half.