Livingston will take a one-goal lead to Firhill in the Premiership play-off final second leg after a deserved home win over Partick Thistle.
Kris Doolan got his head to a long ball from Baily Cargill to nod Partick Thistle in front.
However, within minutes Keaghan Jacobs found space on the right and picked a spot in the bottom far corner.
And when Josh Mullin got to the byline his low cut-back found Scott Pittman to finish from close range.
The two sides meet again on Sunday in Glasgow to determine who plays in the Scottish Premiership next season.
History tells us that the Premiership side tends to triumph in these play-off scenarios. Sometimes the system seems weighted towards that outcome.
In this case, Partick Thistle are the side with all the problems to solve.
They have had a fragility about them over the course of the season and it was clearly evident here.
They knew what Livingston’s approach would be but seemed unable to do too much about it for long spells.
David Hopkin’s side started with real authority and pinned Thistle into their own half in the opening minutes.
The visitors began to edge forward, but came close to conceding when a free-kick was fired deep to the back post with Jackson Longridge heading it back across goal.
They took the lead though when Cargill measured a ball over Alan Lithgow which Doolan anticipated. He timed his run perfectly and nodded home with typical authority.
It was a big question for Livingston but they were undaunted. That they were is perhaps a measure of their mentality given the importance of the occasion.
Within minutes they were level when Jordan Thompson released Jacobs who thrashed the ball past Tomas Cerny from an angle.
The home side continued playing to their strengths. They won high balls, second balls and looked purposeful in possession.
A significant section of the home support believed they had stormed in front when Thompson drilled a low effort just wide of the post.
A similar pattern continued in the second half. The home side dictated much of the proceedings and defended stoutly when required, which was not very often.
Pittman gathered and surged past Cargill, but he had to check slightly allowing Cerny to race from his line and block his shot.
Livingston deserved to take a lead into the second leg and as the clock ticked on they got their reward with a fabulous move.
Substitute Josh Mullin got to the byline and squared for Pittman who slammed high into the net from close range after a lung-bursting run from deep.