Motherwell snatched second place in the Scottish Premiership in the most dramatic and controversial circumstances after Craig Reid scrambled an injury-time winner against Aberdeen at Pittodrie.

The visitors had rarely threatened to get the win they needed in a cagey encounter but they stole a 1-0 victory with almost the last kick of the ball after Keith Lasley's free-kick from just inside his own half caused chaos in the Dons box.

Aberdeen goalkeeper Jamie Langfield appeared to be impeded by Motherwell striker John Sutton, and the ball bounced over him and off the crossbar. An almighty scramble ensued with Fraser Kerr denied on the line but Reid followed up to force the ball home.

The goal punctured the anticipated celebrations for the majority of the 17,016 crowd but sparked wild celebrations among the Motherwell players and their 1,500 fans.

Both teams had already qualified for Europe but there was plenty at stake other than the prestige of runners-up spot. The difference in prize money is £240,000 while there was extra time off available for the players, with a third-place finish meaning a July 3 start in the Europa League rather than July 17 for second spot.

Despite their need for a win, Motherwell manager Stuart McCall brought in defender Kerr for forward James McFadden and played with a 3-5-2 formation rather than the more typical 4-4-2.

Lionel Ainsworth, who scored the only goal when the clubs last met at Pittodrie on Boxing Day, was employed in a central role alongside Sutton to provide pace on the counter-attack but he lasted only 17 minutes before being replaced by Henri Anier after taking an early kick from Jonny Hayes.

Ainsworth had been controversially flagged offside after being sent through but Motherwell otherwise sat back for most of the first half-hour, surviving without major scare.

Hayes caused problems with an early run and cross which Lee Hollis pushed away but the goalkeeper was otherwise untroubled, saving a deflected Niall McGinn shot. Barry Robson had a free-kick blocked by the wall and Scott Vernon just missed a Ryan Jack cross.

Motherwell did not really threaten on the break although Anier got their first shot on target in the 42nd minute after Lasley played the ball into the left channel, Langfield making a comfortable save at his near post.

Motherwell were the first on the attack after half-time and Jack tripped Lasley right on the edge of the box, but Iain Vigurs hit a weak free-kick straight at the wall.

Mark Reynolds glanced a Robson free-kick wide at the other end and Shaun Hutchinson made two goal-saving tackles on McGinn, the second after the Motherwell defence expected a flag following Shaleum Logan's ball forward.

Hollis then prevented Russell Anderson heading home when he punched clear following a corner and saved Reynolds' headed follow-up.

Aberdeen were continuing to push Motherwell back and, although McCall made a change in the 72nd minute, it was an enforced one which did not affect their tactics. Jack Leitch replaced Vigurs, who was struggling with a hamstring strain.

The tactical switch came with 14 minutes left as McFadden replaced Stephen McManus and Motherwell pushed the play up, but they were almost caught on the break with only a contentious offside decision stopping Peter Pawlett finishing off Vernon's through-ball.

A goal continued to look unlikely until the sensational finale, which sealed a second consecutive second-place finish for the visitors.