David Goodwillie struck after just six minutes and Cammy Smith sealed victory in the dying seconds in a match Aberdeen should have won more comfortably.
Niall McGinn clipped the ball into the centre of the penalty area and Goodwillie found the bottom corner with a spectacular overhead-kick.
Smith secured the three points in the final minute as the Dons opened St Johnstone up on the counter-attack and the substitute slotted in from an Adam Rooney pass.
Saints survived a scare after 15 minutes when Alan Mannus had to scramble across to tip a McGinn chip past the post for a corner.
The visitors almost levelled when Steven Anderson flicked his header towards the top-left corner but he was denied as Dons ‘keeper Scott Brown got across to claw away the ball seconds before the break.
Ash Taylor put an effort just over the Saints crossbar as Aberdeen started the second period on the front foot.
McGinn then linked with Peter Pawlett to deliver across the face of goal where Rooney arrived at the back post to slide the ball inches past the target.
Ryan Jack stabbed another attempt wide minutes later, and Andrew Considine met a McGinn corner to head past the post shortly after that.
Saints fired another warning when James McFadden sent in a curling cross for fellow substitute Gary McDonald, but he put his header well wide despite having space to pick his spot.
Despite a nervy finish for the home supporters, Aberdeen held their nerve before securing the win for a sixth straight league success for the first time in 20 years, and a sixth consecutive clean sheet.
They are now a point clear at the summit after Celtic’s match at Partick Thistle was postponed due to a waterlogged pitch.