A spectacular stoppage-time strike from Lewis Ferguson gave Aberdeen the points to take them above a battling Livingston in the Ladbrokes Premiership table after a compelling 90-plus minutes which left the West Lothian outfit going down with their heads held high.

The hosts, 2-1 down at the interval, went into overdrive in the second half, forcing their opponents on to the back foot for the entire 45 minutes as they were pummelled from every angle from a Dons side desperate to gain reward for their superior play. And when the visitors could not clear Niall McGinn’s corner-kick with seconds

remaining – goalkeeper Liam Kelly failing to reach the ball – Ferguson’s scissor-kick strike snatched the points.

It was no more than the Pittodrie outfit deserved, despite going in at half-time behind with Scott Pittman and Jack McMillan cancelling out McGinn’s early opener.

It was former Hamilton midfielder Ferguson who was the hero in the end, but Derek McInnes, the Aberdeen manager, praised his entire squad for their resilience and determination not to accept a share of the points.

“Just when you think it might not happen, Fergie came up with another brilliant goal,” he said. “He has developed a habit of it and I felt it was well deserved, the better team won.

“Big players produce big moments and I would like to see a more regular return of goals from him.

“It was great to see the players get their just rewards for their efforts. We played well for 90-odd minutes but I was disappointed with the goals we lost.

“Livingston are a good side and you have to work very hard to break them down and break their spirit.

“But I have to praise my own team’s spirit and fitness. We ran them from side to side, passed the ball well and played the game in their half for 45 minutes.”

Connor McLennan, a second-half replacement for Scott Wright, also earned plaudits for his performance, especially in setting-up Sam Cosgrove’s equaliser in the 56th minute, a clever clipped ball past Kelly from the young winger’s low cross from the right.

It helped the home fans forget about the two first half breaks that gave Livi the lead, Pittman following-up Craig Sibbald’s shot which was blocked by Joe Lewis and then McMillan accepting Pittman’s touch into his path to place the ball past the Dons goalkeeper.

“We got our rewards in the end,” said McInnes, “and Connor McLennan was a big part of that, I thought he did very well when he came on.

“We have introduced more youngsters this season, it is something that has been aimed at me that I don’t play them enough.

“But we are learning about the younger ones more, they are getting the minutes and it’s good for their development.”

For Livingston manager Gary Holt there was an acceptance that it was always going to be extra tough for his team once the hosts equalised,

but still there was disappointment that the winner came within seconds of the final whistle.

“It’s a sore one to take,” he admitted. “It’s the proverbial kick in the teeth.

“I won’t say we dominated or dictated, we had to stand up to Aberdeen in the second half because they had a real go at us.

“They had some good chances and put us onto the back foot but we defended well at times.

“They are a good side, we rode our luck at times but to lose a goal so late is a sickener.

“We let them get too many balls into our box so we will have to learn from it.

“But I am not downhearted, the desire and commitment was there.

“It’s pain for the players, they gave everything.

“This won’t define us, we know how good Aberdeen are; so it’s disappointing but we will take it on the chin.”