Tommy Bowe grabbed two tries, including a late intercept score, as the Ospreys overcame a determined effort from the Scarlets in an closely-contested Welsh derby at the Liberty Stadium.
With two minutes left on the clock and the Ospreys holding a slender 20-19 lead, Ireland and Lions winger Bowe ran 70 metres to go in under the posts, after picking off a Stephen Jones pass.
The defeat, their 11th of the season, leaves the Scarlets, who were denied a losing bonus point late on, in real danger of missing out on Heineken Cup qualification. They host the Cardiff Blues in a season-defining tie on April 17.
The Ospreys, who are back in the play-off zone courtesy of this win, named an all international starting line-up as they had for the defeat at the Dragons last week.
Lions Alun Wyn Jones, back from an elbow injury, and Shane Williams were also included on the hosts’ replacements bench.
The Scarlets welcomed back their two Lions – Stephen Jones and Matthew Rees – for their first regional starts since the Six Nations. Jones played amid media speculation that is being linked with a move to Leicester Tigers.
It was a typically cagey start from both sides in such a crucial local derby, with neither wanting to give an inch or an early opportunity to the opposition.
Dan Biggar’s eighth-minute drop goal, after a good passing move involving Ryan Jones, Nikki Walker and Andrew Bishop, was cancelled out by a Stephen Jones penalty three minutes later.
Biggar put the home side into the lead with a 16th minute penalty but again it was a shortlived advantage as the Scarlets responded with a finely worked try.
Bustling centre Jonathan Davies crossed the home whitewash after an attack involving Travis Knoyle, Rob McCusker and Rhys Priestland.
In such a nip-and-tuck contest, played out for much of the first half in teeming rain, the Ospreys went back into the lead albeit briefly when Bowe, the recently-named RBS 6 Nations Player of the Championship, crossed in the right corner after good work from Biggar, Bishop and Lee Byrne.
But again the Ospreys only led for two minutes as a Jones penalty gave the Scarlets a 13-11 advantage on 31 minutes.
With the last kick of the half, however, a Biggar penalty goal put the Ospreys into a 14-13 half-time lead.
But Biggar’s radar went adrift in the second half. He missed crucial penalty shots after 46 and 58 minutes.
And significantly Stephen Jones was on target with a 55th minute penalty in front of the posts which put the Scarlets in the lead – 16-14 – for the third time.
The Ospreys thought they had a score through Byrne but referee Christophe Berdos ruled it out for a Bowe push on Andy Fenby.
But with twelve minutes remaining, Biggar rediscovered his range to kick the Ospreys back into a one-point advantage with a drop goal.
Jones and Biggar exchanged penalties in the space of three minutes, but as the Scarlets pressed for the win Jones sent out a pass to the left touchline which was plucked out of the air by Bowe who ran in unopposed to the delight of most of the 13,913 spectators present.
The late try took Bowe’s Magners League try-scoring record to 37 tries, and allowed the Ospreys, including head coach Sean Holley, to breathe a sigh of relief.
"I’m pretty relieved. I think it was a great derby for different reasons," he said afterwards.
"The conditions meant it was quite tactical with a lot of kicking but full credit to the Scarlets, I thought they were excellent and pushed us all the way.
"With this bunch, you’re always confident you can get back in the game."