Last updated on .From the section Football

Niall McGinn clinched Aberdeen's highest league finish in 21 years as victory at Inverness secured at least the runners-up spot in the Premiership.

Edward Ofere shot Caley Thistle into a deserved lead at the start of the second half.

However, the resilient Dons hit back with McGinn's free-kick deflected in by the head of David Raven.

And McGinn's winner moved the Dons back to within five points of Celtic ahead of the leaders' trip to Dundee United.

The result also means Celtic cannot win the league at home to Dundee on Friday even if they pick up the three points at Tannadice on Sunday.

This was Aberdeen's fourth win of the season against the Highlanders but Inverness will be kicking themselves at failing to take anything from a match they dominated in the first half.

Unfortunately for John Hughes and his side they failed to make the most of the chances they created and paid the penalty as the Dons' threat grew on an afternoon when a strong wind made fluent football difficult at times.

Josh Meekings played for the home side after a difficult week for the defender, who was cleared to play in next month's Scottish Cup final after successfully challenging the offer of a ban.

Meekings (right) tackles Adam Rooney in the first half

Bizarrely, there was confusion over whether he could face Aberdeen, with his name appearing on the Scottish Football Association's list of players due to serve suspensions external-link despite only being booked three times this season.

Aberdeen struggled to get their game going when playing into the wind in the first half but Nick Ross and Marley Watkins failed to make the most of the excellent chances the home side created.

Watkins in particular was guilty of a terrible miss shooting into goalkeeper Scott Brown's body when it seemed easier to convert Graeme Shinnie's sweeping cross.

Watkins turned provider early in the second half with a cross for Ofere's header that Brown blocked, but the Nigerian lashed the rebound high into the net.

Then there was agony for last week's Scottish Cup hero Raven as the full-back - who got the extra-time semi-final winner against Celtic - diverted McGinn's free-kick past Ryan Esson.

Six minutes later, McGinn pounced to ram the loose ball in for the winner after an in-swinging Jonny Hayes corner had caused all sorts of problems for the home defence.

Defeat leaves Inverness still looking for a first home win since mid-January and with just four points from the last 24 available, but still on course to finish third, which would be the highest in their 21-year history.

McGinn settled the match with around 16 minutes left