Fly-half Dan Biggar kicked 20 points as Ospreys beat Leinster to keep alive their Pro12 play-off hopes.
Jimmy Gopperth and Biggar exchanged early penalties before the latter added a second penalty, and then converted Jeff Hassler's try.
Cian Healy struck back, but Biggar kicked three more penalties and a drop-goal to Gopperth's three extra shots.
Ospreys remain fifth, but are level on 56 points with fourth-placed Glasgow, who have two games in hand.
And the Welsh region's run-in looks easier than that of their Scottish rivals, who travel to top-four challengers Munster on Saturday, with away games against Ulster and Treviso - plus home fixtures against Edinburgh and Zebre - to come.
Ospreys have three games left - against Welsh rivals Newport Gwent Dragons at Cardiff's Millennium Stadium before an away trip to Zebre and a home match against Connacht.
And Steve Tandy's Swansea-based region will go into their remaining games boosted by a first win of the season over Leinster, who had beaten them twice during the pool stage of the Heineken Cup. The teams also drew in the Pro12 in Dublin in September.
This was a game the Welsh side had to win to retain realistic hopes of being their nation's only representatives in the play-offs.
Gopperth opened the scoring with the game's first penalty before Biggar replied.
Wales fly-half Biggar added a second penalty before playing his part in Hassler's try, his neat pass allowing Richard Fussell, making his 100th appearance for Ospreys, to flick on for Hassler to gather and crash over.
Biggar added the conversion to give the hosts a 13-3 lead as the break loomed.
But sloppy work at the restart allowed Leinster the line-out platform from which their forwards executed a textbook drive for Ireland and British and Irish Lions prop Healy to go over.
Gopperth's conversion kept the contest evenly balanced and, after Biggar kicked two penalties after the break, Leinster's New Zealander sent over three successive shots of his own.
If Leinster had been rewarded for Healy's contribution with ball in hand, the home side had a highly-effective effort from number eight Dan Baker to savour.
His man-of-the-match display helped the home side build the platform from which Biggar dropped a goal in the 71st minute.
Biggar added his final penalty two minutes from time, and Leinster's late efforts faltered as replacement scrum-half Darragh Fanning and Gopperth knocked on.
Ospreys: Richard Fussell; Jeff Hassler, Jonathan Spratt, Ashley Beck, Aisea Natoga; Dan Biggar, Tom Habberfield, Duncan Jones, Scott Baldwin, Aaron Jarvis, Ryan Jones, Alun Wyn Jones (capt), Joe Bearman, Dan Baker, Justin Tipuric.
Replacements: Replacements: Hanno Dirksen for Natoga (52), Nicky Smith for Jones (61), Adam Jones for Jarvis (61), James King for Bearman (61), Morgan Allen for Baker (75), Sam Davies for Beck (76),
Not Used: Otten, Tebaldi, Davies.
Leinster: Rob Kearney; Zane Kirchner, Gordon D'Arcy, Noel Reid, Dave Kearney; Jimmy Gopperth, Isaac Boss; Cian Healy, Sean Cronin, Martin Moore; Leo Cullen (capt), Mike McCarthy; Kevin McLaughlin, Jamie Heaslip, Shane Jennings.
Replacements:Replacements: Collie O'Shea for D'Arcy (71), Darragh Fanning for D Kearney (75), Luke McGrath for Boss (75), Mike Ross for Moore (60), Devin Toner for Cullen (64), Jordi Murphy for McLaughlin (41).
Not Used: Dundon, Bent.
Referee: Marius Mitrea (Italy)
Assistant Referees: Neil Hennessy, Jon Mason (both Wales)
Citing Commissioner: John Charles (Wales)
TMO: Gareth Simmonds (Wales)