
Aberdeen recorded a their first victory since September thanks to a late penalty from Lee Miller.
St Johnstone lost Graham Gartland to a shoulder injury before Sone Aluko gave the Dons the lead on 15 minutes.
Liam Craig had a shot cleared off the line before levelling for the visitors from close range with 14 minutes left.
But Aberdeen regained their lead in the 83rd minute, courtesy of Miller's penalty after the striker had been fouled in the box by Danny Grainger.
The home side turned in just about their most impressive performance of the season in the first 45 minutes but ran out of steam after the break, allowing the Saints right back into a keenly contested affair.
Aluko could have scored inside two minutes when he latched on a searching pass from Charlie Mulgrew only to shoot into the side-netting from an acute angle.
The visitors responded three minutes later with a fine passing move that ended with Finnish striker Jonatan Johansson firing inches wide.
The Saints were forced to make a change after nine minutes with Steven Anderson coming on for central defender Gartland, who hurt himself after landing awkwardly.
Aberdeen took the lead with a fine counter-attacking move expertly finished by Aluko. Peter Pawlett showed excellent pace and strength to shrug off Grainger before finding the Nigerian, who dribbled past two defenders before slotting the ball past Graeme Smith.
Pawlett then showed an abundance of speed to out-sprint the visiting defence before unleashing a left-foot shot that was clawed away by Smith.
Smith was called into action soon after to thwart Pawlett with the St Johnstone goalkeeper doing well to hold a powerful effort.
Opposite number Jamie Langfield pulled off a superb near-post save to deny Samuel on 42 minutes to ensure the Dons went into the interval a goal in front.
Aberdeen substitute Darren Mackie, on for the injured Aluko, almost made an immediate impact when he earned a yard of space in the box with a terrific piece of skill before smashing a shot from a tight angle off the post.
Jerel Ifil almost doubled Aberdeen's side lead with a neat shot on the turn that was excellently tipped over the bar by Smith.
The former Swindon defender was then the hero at the other end when he cleared a Kenny Deuchar header that had beaten Langfield off the line.
Ifil came to the rescue for Aberdeen again on 73 minutes when a Langfield punch fell kindly into the path of former Don Kevin Rutkiewicz, who lobbed the ball over the stranded keeper, but the defender again headed the ball to safety.
St Johnstone's mounting pressure paid off when they got back on level terms. Langfield dropped a hanging cross from David Mackay under pressure from Deuchar and Craig pounced on the loose ball to roll the ball into the unguarded net.
The Dons were presented with opportunity to regain the lead when Miller was bundled over in the box by Grainger and the striker kept his composure to drill the spot-kick home himself.
Paton could have put the icing on the cake for the home side with a ferocious 30-yard shot that rebounded back off the crossbar in the dying stages.
Aberdeen manager Mark McGhee:
"After having such a good first half, we ran out of energy and a lot of the pace that had caused St Johnstone problems went from our team.
"They put us under pressure with a lot of long balls and we thought their goal was illegal - there was a foul on the keeper.
"They didn't play through us at any stage and I thought we defended well.
"They asked questions of us with the long ball and we answered them."
St Johnstone manager Derek McInnes:
"I'm fed up getting let down by poor decisions. It was never a penalty.
"There's a foul from Lee Miller on Danny Grainger in the build up and the award was given for a coming together - it was no more than that.
"We were the better team for the whole of the second half, no question about that.
"We've had three penalties given against us this season and not one of them has been a penalty.
"I can understand Aberdeen's frustration with our goal but, for me, there wasn't a lot in it."