St Johnstone gave themselves the perfect pre-final boost by ending Livingston’s 14-game unbeaten run.
This was a Premiership dress rehearsal for the Betfred Cup decider between the sides at Hampden at the end of the month.
The psychological boost was definitely claimed by Saints thanks to a confident and composed display in West Lothian.
The visitors took a perfectly-timed lead just before the interval when Scott Tanser scored with an excellent setpiece.
The McDiarmid men were two up six minutes after the restart when Shaun Rooney headed home.
They could have been in front after just a couple of minutes but Jason Kerr shot over from close range at the back post – following David Wotherspoon’s corner – when the defender should have scored.
The first half was, thereafter, a stuffy, physical battle…until the final few seconds of stoppage-time.
After Saints striker Chris Kane was fouled by home defender Aaron Taylor-Sinclair just outside the box, Tanser curled a wonderful freekick up and into the Livi net just before the half-time whistle was blown.
Then, with 51 minutes on the clock, Rooney jumped superbly to head home after Liam Craig had sent another freekick into the box.
On 79 minutes, St Johnstone blew the chance to make it 3-0 when substitute Stevie May blasted his penalty straight at Livi keeper Max Stryjek following a foul on Rooney by Nicky Devlin.
Scott Pittman grabbed a goal back for the hosts on 83 minutes with a header off Jason Holt’s assist but Saints held on to claim the points and a wonderful pre-Hampden shot in the arm.