Ulster suffered a first loss in 2014 after going down 28-23 to Cardiff in a nail-biting encounter at the Arms Park their RaboDirect PRO12 clash.
Fly-half Gareth Davies contributed 23 points to a Cardiff team that had suffered five successive defeats prior to Ulster's visit.
At the start it looked as though it would be more of the same as Ulster centre Darren Cave handed off full-back Dan Fish to speed over for a simple opening try, even if Paddy Jackson was wide with the conversion.
Then a Tommy Bowe kick ahead was hacked dead by Blues scrum-half Lewis Jones, giving Mark Anscombe’s charges a five-metre scrum, but the seemingly inevitable second try was spurned due to a knock-on. Instead, the Welsh region cut the deficit with a Gareth Davies penalty.
The Blues, with tall threequarters Cory Allen and Alex Cuthbert looking lively, enjoyed a spell of territorial advantage and another Davies penalty put them in front after 25 minutes.
Ulster suffered a double blow when lock Dan Tuohy was sin-binned for an offence at the tackle and Davies punished them further with the resulting penalty, before the Blues pack embarked on a mighty 40-yard rolling maul which brought Davies his fourth successful kick.
And the complete turnaround of fortunes was underlined when Robin Copeland, in his 50th game for the Blues, grabbed a loose ball on halfway and fed Cuthbert, who sped inside before returning the pass with some neat sleight of hand to send the number eight over.
Davies added the conversion and another penalty to make it 22-5 at half-time.
Ulster reappeared with renewed energy after the interval, though, and Jackson kicked three points when Jones transgressed, before then repeating the feat after the home side handled in a ruck.
Andrew Trimble almost created an Ulster try when he collected his own kick only to unleash a wild pass, but the visitors kept up the pressure and centre Luke Marshall reached over only for the combined efforts of Josh Navidi and Isaia Tuifua prevented him grounding the ball. Italian referee Marius Mitrea had been playing advantage and Jackson landed the penalty.
The Blues, with flanker Navidi involved in everything, stormed back and a Davies penalty extended the lead, only for Jackson to reply with three of his own and close the gap to two points with five minutes left.
A superb tackle by Allen prevented an Ulster break-out before Cave conceded a silly penalty, Davies put over his eighth kick of the match and the Blues managed to survive the final frantic exchanges as Ulster pressed for a match-saving try.