It made up for last week's setback when Scarlets drew 16-16 in Zebre and also ended Ulster's four-game winning streak.
Both sides went into the game stripped of a significant amount of internationals.
The Scarlets were without seven players away on international duty, meaning that Kirby Myhill started at hooker and prop Samson Lee returned after a two-week suspension.
Ulster were without eight players on international duty but Andrew Trimble and Roger Wilson were released by Ireland.
Apart from the opening exchanges when Ulster opened the scoring with a Ruan Pienaar penalty after nine minutes, Scarlets enjoyed the wealth of possession and territory for the rest of the first half.
But it took the Scarlets time to convert that pressure into points.
At one stage they went through 33 phases in Ulster's 22 but came away with nothing as the visitors' defence held firm.
Nic Reynolds broke through on another attack but although Lee went over the try was ruled out for obstruction.
Scarlets finally got on level terms with a Steven Shingler penalty after 22 minutes.
The home side's dominance finally paid dividends when Earle went over for a try from a line-out drive after 32 minutes.
And just before the break Thomas, on for the injured Shingler, kicked a penalty to give the region an 11-3 interval lead.
Pienaar closed the gap with a penalty five minutes into the second half as Ulster enjoyed a bit more possession
But Scarlets' first concerted attack of the half produced a yellow card and a penalty.
Replacement David McIlwaine found himself in the bin for slowing the ball at a ruck in the Ulster 22, and from the resulting penalty Thomas kicked Scarlets back into an eight-point lead at 14-6.
But that was cancelled out when Pienaar landed his third penalty 11 minutes from time following a Scarlets scrum offence.
And Pienaar had the chance to reduce the gap to just two points but uncharacteristically missed the target with eight minutes remaining.
Flanker Roger Wilson received a yellow card following blatant trip on man of the match Sione Timani.
Crucially for the Scarlets, Thomas kicked a third penalty with three minutes remaining to put his side two scores in front.
- Sports & Recreation
- Ruan Pienaar