The Ospreys knocked Edinburgh off their perch at the top of the Celtic League, helped by 22 points from the boot of full-back Gavin Henson.
Ospreys (13) 42
Tries: Gibbs, Connor, Newman, Storey
Cons: Henson (2)
Pens: Henson (6)
Edinburgh (13) 18
Tries: Lee, Southwell
Pens: Warnock (2)
They also scored four tries at the Gnoll, which ensured a crucial bonus point.
Hope of a home victory was in some doubt at half-time with the two sides locked 13-13 as the Ospreys endured a strong wind in their faces.
But five penalties for man-of-the-match Henson at the start of the second half gave the Ospreys an important 15-point cushion at 28-13.
The Ospreys, however, rather sat back on their advantage and Edinburgh were allowed to respond with a try through left-wing Hugo Southwell.
Despite losing skipper Scott Gibbs with a dead leg at the beginning of the second half, his stand-in Barry Williams rallied the troops for a big finish.
Though renowned for an expansive game, it was from a line-out drive that the Ospreys earned their third try for the lock Andy Newman.
With the match all but sealed, the Ospreys went in search of a bonus point and it duly arrived when replacement centre James Storey broke free from a tackle to go over.
In the first half, Gibbs crossed for a try along with outside-half Shaun Connor to cancel out a five-pointer from Derrick Lee after the Scottish side had led 10-3 after 15 minutes.
The Ospreys will now be hoping Gibbs recovers in time for the difficult trip to face Cardiff Blues at the Arms Park next Saturday.
Ospreys: Gavin Henson; Elvis Seveali'l, Dave Tiueti, Scott Gibbs (capt), Gareth Morris; Shaun Connor, Andy Williams; Paul James, Barry Williams, Andrew Millward, Andy Newman, Luke Tait, James Bater, Richie Pugh, Nathan Bonner-Evans.
Replacements: James Storey, Clatworthy, Rhodri Wells, Chris Wells, Cai Griffiths, Lyndon Bateman, Gavin Thomas.
Edinburgh: Lee; Sharman, Joiner, Philip, Southwell; Warnock,
Burns; Smith, Kelly, Brannigan, Perrett, Strokosch, Blackadder,
Cross, A Hogg.
Replacements: Di Ciacca, Jacobsen, Callam, A Dall, Lawson,
Di Rollo, Webster.
Referee: David Keane (Ireland)