St Johnstone moved level on points with fifth-place Dundee in the Scottish Premiership after Kai Fotheringham's second-half winner settled an error-strewn Tayside derby in Perth.
Josh Campbell, on his return to the starting line-up, had St Johnstone in front after five minutes when he headed home Enes Alic's cross.
Simo Valakari's side should have doubled their advantage when Taylor Steven failed to direct his volley on target after Alic's strike was parried into his path.
A fortunate goal brought Dundee level within two minutes of the restart. St Johnstone defender Cheick Diabate clattered into goalkeeper Ross Sinclair, causing him to drop the ball straight to the feet of half-time substitute Joe Westley, who easily slotted home.
But poor defending from the visitors allowed St Johnstone to secure victory. Steven Pressley's side failed to clear their lines and Campbell's blocked shot fell kindly for Fotheringham, who bundled the ball into the net.
Ryan Finnigan thought he had hauled Dundee level when he fired beyond Sinclair from close range, but referee David Dickinson felt there was a foul in the build-up.
St Johnstone also had a goal of their own disallowed when Macaulay Tait tapped in from close range, only to be flagged offside.
Valakari's side remain seventh but are now level on points with Dundee and Dundee United.