Wales scrum-half Rhys Webb scored two tries as Ospreys held on to seal a 29-28 bonus-point victory over Cardiff in the Guinness PRO14 at the Liberty Stadium.
Webb dotted down either side of half-time, with Jeffrey Hassler's effort midway through the first half and Justin Tipuric's score after the interval lifting Ospreys into a 29-14 lead with 17 minutes remaining.
Converted tries from Owen Lane and Garyn Smith set up a tense finale but Ospreys held on to triumph in the Welsh derby.
They had gone into the break with a 17-14 advantage but they did not have it their own way in the first half.
It was Blues that started the stronger, opening up an 8-0 lead helped with a Gareth Anscombe penalty goal from in front of the posts after only two minutes.
A Rey Lee-Lo break set up a good position for Cardiff's opening try and from a scrum Josh Navidi went close before number eight Williams crashed over. Anscombe missed the conversion.
But the home side came right back five minutes later when Hassler picked off an interception pass from Matthew Morgan and he ran to go over down the right despite a last-ditch tackle from Alex Cuthbert. Biggar converted.
An Anscombe penalty gave Cardiff a four-point cushion but almost from the restart Ospreys claimed their second try. Biggar chipped over the midfield, regathered and put Webb over with a neat pass before adding the extras.
In the space of two minutes Anscombe and Biggar swapped penalties.
Ospreys then produced a brilliant try 12 minutes into the second half. Ashley Beck took a cross kick from Biggar and Tipuric sent Webb to the line for the score converted by Biggar.
Ospreys pressure forced Cuthbert offside and he was yellow-carded by referee Nigel Owen.
With the penalty on the left-hand side, Biggar spotted Tipuric free on the right and the outside-half put in a fine cross-kick for the Wales flanker to collect the bonus point try.
At that stage Ospreys looked comfortable but in dramatic fashion Cardiff scored two tries in the space of three minutes to trail the home side by just a point going into the final few minutes.
First Lane crashed over the in the right corner for a try converted by Anscombe before Smith also went over. The score was converted by Anscombe.
The Blues sensed a dramatic victory and after a break, when Ospreys centre Owen Watkin was stretchered from the field, the visitors worked their way upfield until Josh Navidi knocked on.