The visitors edged an entertaining match where the lead swapped hands a number of times in the opening period
This close fought encounter at the Arms Park could have gone either way with both sides producing moments of enterprise and some entertaining rugby.
Both sides also left more than their fair share of points on the field, however.
Ultimately it was Llanelli who took the victory by a margin that perhaps flatters them slightly but which gives them the league double over Cardiff as well as some revenge for their cup defeat to the same side.
It was the visitors who opened the scoring in the ninth minute, Outside Half Steven Shingler successfully converting a penalty kick after missing an earlier attempt.
Cardiff struck back quickly from the restart, however, when skipper Dafydd Hewitt charged down an attempted clearance kick before following up for the touchdown.
The Blue and Blacks extended their lead seven minutes later when Llanelli were penalised for going in from the side at a ruck, outside half Dean Gunter claiming the three points.
The visitors regained the lead in the 24th minute with a penalty try awarded by referee Greg Morgan when Llanelli flanker Dan Thomas was obstructed after driving his way over the Cardiff line.
The remainder of the first period saw both sides develop attacking opportunities but failing to convert them with an exchange of penalty kicks leaving Llanelli with a two point advantage at the interval.
From the restart, it was the visitors who had the best of the early play, getting to within five metres of the Cardiff line before conceding a scrum and subsequent penalty.
A penalty of their own soon got Llanelli back into their opponents' 22m however where a further penalty enabled Shingler to extend his side's lead.
Cardiff quickly hit back with a penalty of their own and while they then lost centre Tom Pascoe to a yellow card it was Llanelli who paid the higher price for indiscipline, with another penalty giving the lead back to the home side.
The home fans' joy was short lived, however, as a blistering run by full-back Dion Jones produced a try to restore Llanelli's advantage and from a quickly taken penalty in their own 22, wing Josh Adams touched down for the best try of the game.
Cardiff battled to get back into the game and as it moved past the 80 minute mark, Outside Half Dean Gunter broke through the Llanelli defensive line for a try that he went on to convert.
A Cardiff error at the restart produced a kickable penalty opportunity that could have settled the game for Llanelli but Dion Jones's effort sold wide.
The full-back had another opportunity moments later, however and this time he made no mistake from the 10 metre line, his kick immediately being followed by the final whistle.
Cardiff Tries: Dafydd Hewitt, Dean Gunter. Con: Dean Gunter. Pens: Dean Gunter (4)
Llanelli Tries: Pen, Dion Jones, Josh Adams. Cons: Stephen Stringer, Dion Jones. Pens: Stephen Stringer (3), Dion Jones.
Cardiff RFC 24 - 31 Llanelli RFC
courtesy of Wales Online