Motherwell's hopes of securing a top-six Scottish Premiership finish are over after they lost 3-1 against Aberdeen at Pittodrie.

The visitors needed to win and hope Hibernian dropped points to keep their chances alive, but got off to the worst start when Max Lowe's cross looped in.

Motherwell equalised through Jake Hastie before half-time.

But Aberdeen regained control, Niall McGinn scoring twice to keep up the pressure on third-placed Kilmarnock.

Derek McInnes' side move level on points with the Ayrshire club, with only the top three guaranteed a European place next season.

Aberdeen rediscover home comforts

A nervy start by Aberdeen might have been expected, given they have not won in the league at Pittodrie this year. But McInnes' men began this game like they had a point to prove, with fine link-up play between the likes of McGinn, Connor McLennan and Lewis Ferguson, conducted from deep by captain Graeme Shinnie.

While the opening goal had more than a hint of good fortune about it, there was no doubt that the hosts deserved it. Lowe played a quick one-two with McLennan from a throw-in and his attempt to pick out Sam Cosgrove in the box took Mark Gillespie by surprise, looping over the Motherwell goalkeeper and bouncing in off the post to give Aberdeen the lead inside five minutes.

More chances followed, with Ferguson and Cosgrove both threatening, but the visitors managed to hold firm and gain a foothold in the match.

The tempo dropped just after the half-hour mark, with both sides seemingly feeling the effects of a frantic opening, but Stephen Robinson's side found a spark. That came through Richard Tait, who expertly threaded a defence-splitting pass through to Hastie, who had managed to get goalside of Lowe. He controlled and rounded Joe Lewis before tapping in the equaliser.

It was Motherwell's first chance of note, but it was enough to allow doubts to creep in to the minds of the Aberdeen players and fans, with a seventh consecutive home league game without a win beckoning.

But the hosts came out fighting in the second half. A collision between Cosgrove and Gillespie led to the goalkeeper being replaced by 21-year-old Rohan Ferguson, whose first task was to pick the ball out of his own net. Substitute Greg Stewart's low shot was half-blocked by Tom Aldred and landed at the feet of McGinn, who slammed the ball in to the roof of the net.

Motherwell made changes to try to get back in to the game, and came close to earning a point when Liam Grimshaw ghosted in to meet Carl McHugh's cross, but his looping header went just wide.

Seven minutes of injury time followed because of the treatment Gillespie received, allowing McGinn to wrap up the match in style. He picked up the ball on the left-hand side, before cutting in and curling a beautiful effort past Ferguson to seal all three points.

Derek McInnes side secured a first home league win of 2019

'Sense of relief at Pittodrie' - analysis

BBC Scotland's Tyrone Smith at Pittodrie

A big win for Aberdeen and the importance of the three points was matched only by the sense of relief which was emanating from the Pittodrie stands at the final whistle. McInnes will be hoping this victory can breathe some fresh impetus into a campaign which could still yield plenty for his side over the coming weeks.

Motherwell will be disappointed to miss out on a top-six place, but heartened by the progress they have made in recent months. Whether manager Stephen Robinson can continue that next season will be determined by the business he does during what looks like being a busy summer of departures and arrivals at Fir Park.

'I can't fault the effort' - reaction

Aberdeen manager Derek McInnes: "I thought it was a strong performance. I thought we had plenty of chances to get our second goal at 1-0.

"When we did press them we looked a real threat on the counter attack. There's good speed and energy in the team. Getting three points at home was vitally important."

Motherwell manager Stephen Robinson: "They scored an incredibly lucky goal, which makes it an uphill task but the players showed character. We started the second half going long and by the time we started playing again it was too late.

"We lacked decisions in the final third in the second half. It wasn't to be I can't fault the boys effort and commitment."