The Ospreys edged a lacklustre Pro12 derby against the Newport Gwent Dragons in the second of Sunday's two Welsh derbies at the Millennium Stadium.
Despite dominating large chunks of the game, Ospreys wasted chance after chance in a scoreless first half.
A brilliant counter-attack saw Richie Rees put the Dragons ahead against the run of play.
But Tom Habberfield's close-range try and a late penalty try for a collapsed scrum gave the Ospreys victory.
The Ospreys started the afternoon in fifth place in the table and needing a handsome win if they were to keep the pressure on Glasgow and Ulster for a play-off place.
The Dragons, languishing in 10th, were seeking to end a run that had seen them lose their previous four Pro12 encounters against their Welsh rivals.
The Gwent side's cause had been further undermined by two enforced late changes, with Tyler Morgan in at 13 for Pat Leach and Cory Hill starting at lock for skipper Andrew Coombs, stricken with tonsillitis.
The Ospreys should have been a try to the good within the first five minutes, but twice Hanno Dirksen was brought down short and then a knock-on denied Richard Fussell a try against his former side.
Only some inspired defence and a lot of poor options kept the Dragons' line intact, a point underlined when Ospreys number eight Dan Baker lost the ball as he stretched for a try.
When they earned a penalty in front of the posts, Ospreys spurned the kick in favour of an attacking line-out that came to nothing.
That plan was repeated at the next available opportunity and despite a brilliant touch-finder from Dan Biggar, Dragons again splintered the drive.
The efforts in defence did take their toll, with Netani Talei limping off to be replaced by Nic Cudd, but the Dragons held firm.
When Justin Tipuric spilled a ball in the tackle, Dragons saw their chance and hacked upfield.
Fussell just got back first but was swamped by the chasing black shirts, forcing Ryan Jones to kill the ball and earn a yellow card - leaving Ospreys with 14 men for the rest of the half.
But the Dragons could not take advantage and a disappointing first 40 minutes ended scoreless.
The first score when it finally arrived was almost worth the wait as the Dragons fashioned a move of sheer brilliance.
Hallam Amos flicked the ball out of the back of his hand to Morgan, who found rampaging lock Hill on his inside shoulder.
Rees took the move on and the scrum-half scampered in under the posts to make Kris Burton's conversion a simple one.
Biggar at last got the Ospreys on the scoreboard with a penalty after Cudd had been sin-binned for a piece of cynical shirt-tugging.
The Dragons had only just introduced Jason Tovey for Burton before the fly-half took a blow to the head and had to be helped off with suspected concussion, so Burton was allowed to return to action.
With 20 minutes remaining the Ospreys at last broke through when scrum-half Habberfield sniped over from the base of a ruck.
Biggar's conversion opened up a three-point lead but when Jonathan Spratt was caught off-side moments later, Dragons wing Tom Prydie kicked the resulting penalty to make it 10-10.
Adam Jones, the Wales and Lions prop whose future at the Ospreys is still undecided after this season, had earlier come on and the change paid dividends at the next scrum.
The Dragons pack was shoved back and up and Biggar kicked the penalty from 40 metres out.
Morgan became the second Dragon to be sin-binned as he desperately tried to stifle quick Ospreys possession.
The Liberty Stadium side turned the screw and their already dominant eight shattered another Dragons scrum to earn a late penalty try, Biggar converting for a 20-10 victory.
Dragons: Hallam Amos; Tom Prydie, Tyler Morgan, Jack Dixon, Will Harries; Kris Burton, Richie Rees; Phil Price, T Rhys Thomas, Duncan Bell, Cory Hill, Matthew Screech, Netani Talei, Lewis Evans (capt), Taulupe Faletau.
Replacements: Sam Parry for Thomas (74), Owen Evans for Price (70), Bruce Douglas for Bell (74), Jevon Groves for Hill (74), Nic Cudd for Talei (21), Jonathan Evans for Rees (79), Lewis Robling for Evans (79), Jason Tovey for Burton (52), Burton for Tovey (57).
Ospreys: Richard Fussell; Jeff Hassler, Jonathan Spratt, Ashley Beck, Hanno Dirksen; Dan Biggar, Tom Habberfield; Duncan Jones, Scott Baldwin, Aaron Jarvis, Ryan Jones, Alun Wyn Jones (capt), James King, Justin Tipuric, Dan Baker.
Replacements: Scott Otten, Nicky Smith for D Jones (52), Adam Jones for Jarvis (61), Tyler Ardron for King (74), Sam Lewis for Tipuric (70), Tito Tebaldi for Habberfield (75), Sam Davies for Fussell (44), Aisea Natoga for Hassler (70).
Sin Bin: Ryan Jones (33), Cudd (52), Spratt (64), Tyler Morgan (76).
Referee: Nigel Owens (WRU)
Assistant Referees: Neil Hennessy, Jon Mason (both WRU)
Citing Commissioner: Dennis Jones (WRU)
TMO: Derek Bevan (WRU)