|Ospreys (13) 27|
|Tries: Underhill, Otten Con: Davies Pens: Davies 5|
|Edinburgh (13) 13|
|Tries: Dell Con: Tonks Pens: Tonks 2|
Ospreys climbed into the top six of the Pro12 with a hard-fought victory over mid-table rivals Edinburgh.
The Scots led 13-6 at one stage thanks to a try from prop Alan Dell.
But Sam Underhill's touchdown levelled the scores, before Sam Davies' string of second-half penalties and a late Scott Otten try sealed the hosts' win.
Wales flanker Dan Lydiate spent time in the sin-bin before playing his part in the Ospreys' revival.
Glasgow's win against Munster means Ospreys leapfrogged the Irish province into sixth place, the last of the European Champions Cup qualifying spots.
The opening stages were a battle of the boot between Davies and Greig Tonks, with both men landing two penalties in the first 25 minutes.
Edinburgh were having the better of the territory battle and broke through for the first try on 26 minutes.
Lydiate was stripped of possession on his own 22 and Tonks' break put prop Dell over between the posts, Tonks converting.
Ospreys managed to crack the solid visitors' defence on 34 minutes with a chip from Davies superbly gathered by Ben John to put Underhill over in the corner, Davies adding the extras.
But Lydiate's chances of impressing Wales coach Warren Gatland took a knock when he was judged not to have used his arms in a tackle on Anton Bresler and was shown the yellow card by referee Marius Mitrea.
Ospreys gradually took charge of a dour game with Davies landing penalties after 45, 61 and 71 minutes.
Edinburgh also fell foul of Mitrea's whistle after a series of ruck penalties, with captain Neil Cochrane being sin-binned in the last quarter.
Lydiate was eventually replaced after 73 minutes having put in his share of tackles in his effort to earn a Wales starting place, but it was back-row colleague Dan Baker who earned the man-of-the-match accolade.
Otten's close-range score with three minutes left killed off the Scots' chances of rescuing a losing bonus point and left them just ahead of the Ospreys in the Pro12 table on points difference.
Meanwhile, World Cup final referee Nigel Owens was on duty on the touchline instead of Craig Evans, whose late offside call against Edinburgh saw them lose in the last minute away to Scarlets seven days previously.
Ospreys: Dan Evans; Jeff Hassler, JJ Engelbrecht, Owen Watkin, Ben John; Sam Davies, Brendon Leonard (capt); Nicky Smith, Sam Parry, Ma'afu Fia, James King, Rory Thornton, Dan Lydiate, Sam Underhill, Dan Baker.
Replacements: Scott Otten, Gareth Thomas, Aaron Jarvis, Rynier Bernardo, Olly Cracknell, Tom Habberfield, Josh Matavesi, Eli Walker.
Edinburgh: Greig Tonks; Dougie Fife, Michael Allen, Sam Beard, Tom Brown; Phil Burleigh, Sean Kennedy; Allan Dell, Neil Cochrane (capt), John Andress, Anton Bresler, Ben Toolis, Jamie Ritchie, Hamish Watson, Cornell Du Preez
Replacements: George Turner, Grant Sheills, Simon Berghan, Grant Gilchrist, Magnus Bradbury, Sam Hidalgo-Clyne, Chris Dean, Blair Kinghorn.
Referee: Marius Mitrea (FIR)
Assistant referees: Nigel Owens, Sean Brickell (WRU)
Citing commissioner: Aurwel Morgan (WRU)
TMO: Tim Hayes (WRU)