The hosts were on a run of 20 straight GUINNESS PRO12 defeats, stretching back to 20 February 2015, when they beat the Blues at the same venue.
Cardiff, who were chasing a fifth straight GUINNESS PRO12 victory were a point to the good at half-time after Blaine Scully crossed the line.
However, a penalty try early in the second half and a stubborn defensive display for much of the final 20 minutes secured a hard-fought 13-7 triumph.
At the other end of the table, Ulster remain top of the pile above Connacht on points difference after edging out Glasgow Warriors in a tight affair at the Kingspan Stadium.
Craig Gilroy was named man of the match, while Callum Black scored the only try of the game for the hosts on his 100th Ulster appearance.
Ulster where 5-3 down at half-time but a second-half penalty from Paddy Jackson and Black's converted try were enough to earn a win for the Ulstermen despite Taqele Naiyaravoro's late consolation for the visitors.
This win extends Ulster's recent run to just one loss in their last six GUINNESS PRO12 fixtures.
Connacht and Leinster both leapfrogged the Scarlets with impressive victories to occupy second and third spot respectively.
Newport Gwent Dragons led 15-14 at half-time against Connacht but two second-half converted tries guided Pat Lam's side to victory.
Matt Healy and Tiernan O'Halloran saw first-half tries cancelled out, but Bundee Aki and Eoghan Masterson each crossed over to the leave the final score 21-26.
Leinster, meanwhile, were potentially the most impressive side of the weekend as they won 52-0 against Zebre at the RDS on Friday night.
They are now undefeated in ten games on home soil and on this form will prove a stern test for any team that visits the Irish capital.
The hosts had secured the bonus point by half-time thanks to tries from Hayden Triggs, Isa Nacewa, Luke McGrath and Adam Bryne, while Jordi Murphy, Sean Cronin, Garry Ringrose and Cian Kelleher added further scored after the break.
Despite a one-point victory over Edinburgh, Scarlets dropped to fourth in the PRO12 table, just one point behind pace-setters Ulster.
The Welsh side looked like they were cruising to victory with a 13-3 half-time lead which was extended to 19-6 before the hour-mark.
Tries from Cornell Du Preez and Alex Toolis turned the game on its head before Aled Thomas held his nerve to score a last-gasp penalty and snatch a 22-21 victory.
Ospreys climbed to within touching distance of the top six with an away victory over Munster, thanks in part to the boot of Sam Davies.
The Irish side took an early lead thanks to Duncan Williams before Davies hit back, but Francis Saili and Robin Copeland crossed either side of the break to put the hosts firmly in charge.
However, Owen Watkin climbed off the bench to pull a try back and the boot of fly-half Davies saw them over the line to leave them three points behind Munster in sixth spot.
TRY OF THE WEEKEND
Munster's Francis Saili scored his first try for the club as he demonstrated great feet and an excellent burst of pace. The outside centre collected the ball just inside the Osprey half, spotted the gap, burst through it and then skipped past the Ospreys defence without being touched to dive over in the corner in style.
BREAK OF THE WEEKEND
With Leinster in full control and the bonus point in the bag Cian Kelleher decided it was about time to score his first GUINNESS PR12 try, and did so in fine fashion. The 21-year-old full-back collected a kick inside his own half and showed an extraordinary burst of pace to fly through the tiring Zebre defence, skipping through the initial tackles and then crossing the line unchallenged.
PLAY OF THE WEEKEND
Despite eventually losing to Ulster, Glasgow's opening try may well go down as one of their highlights of the season after some superb play from their young backline. Upon winning a line out, Glasgow drove Ulster back before quick hands released centre Sam Johnson to burst through the Ulster defence. He was then able to release the ball, which was worked out to the touchline where Lee Jones was able to cross in the corner.
PLAYER OF THE WEEKEND
Benetton Treviso claimed their first win of the GUINNESS PRO12 season against Cardiff Blues and Jayden Hayward certainly played his part. As well as holding his nerve from the tee to kick eight vital points, the full-back was the last line of an unusually resilient defence that held firm right until the final whistle.
To buy tickets for the GUINNESS PRO12 Grand Final click here. Also follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12.