Neil Doak’s men found themselves 12-0 down at half-time and despite a spirited comeback that saw them get back to within two points in the final 10 minutes, they let the chance of an unlikely victory slip through the fingers.
The concession of nine first-half penalties allowed Wales international outside-half Rhys Priestland to build a lead for the home side with the boot before a late James Davies try kept them in contention to qualify out of pool three behind leaders Toulon.
Ulster head coach Neil Doak said: “We started the second half so well and had a couple of gilt-edged chances than went a-begging but the first half was poor.
“To give away nine penalties, six in our own half, allowed them to get points on the board and we never really recovered from that.
“It’s going to be very, very difficult now to get out of the group. Three wins would have put us there or thereabouts but we just have to see how the next few games go.”
The home side broke the deadlock after 12 minutes when Liam Williams pinned Ulster deep in their own half with an excellent kick.
Franco van der Merwe was penalised at the line-out and Priestland stroked over the penalty. He had a second eight minutes later as the Scarlets had Ulster on the back foot.
Captain Scott Williams powered through a soft Ulster defensive line to make 30 metres and when the ball went to ground, Rory Best was punished for not releasing the player.
The Scarlets were far from dominant but they were more disciplined and structured in their play and when Dan Tuohy drifted offside for Ulster, Priestland added a third penalty.
Priestland has faced criticism from the Parc y Scarlets faithful at times this season for his kicking but when Callum Black was penalised near the halfway line the 27-year-old had no hesitation in going for the posts and adding another three points.
Ulster needed a response after the interval and it arrived just 77 seconds into the second half.
Darren Cave picked a superb angle to break the line before exchanging passes with centre partner Luke Marshall to beat Scarlets full-back Williams and go in under the posts.
Ian Humphreys added the conversion but Ulster almost allowed Scarlets to claw back three points immediately when they gave away a penalty at a scrum but Priestland was off-target with the boot.
The visitors should have added a second try with just under half an hour remaining when they got to within five metres of the Scarlets’ line but they made a mess of a driving lineout and the chance was lost.
It looked as though they would have to settle for three points a minute later when they were gifted a penalty in the Scarlets’ half but it was Humphreys’ turn to be off-target from the tee.
Priestland found his range again with a fifth penalty on the hour before Ulster prop Declan Fitzpatrick was shown a yellow card for repeated infringements at the scrum.
Instead of swinging the game in the Scarlets’ favour, it only served to add fuel to Ulster’s fire and two Ruan Pienaar penalties in as many minutes brought Ulster to within two points.
Pienaar then had the chance to put Ulster in front for the first time in the game but he could only push his third attempt at goal wide of the right hand post.
It proved to be a crucial miss when two minutes from time, Scarlets flanker Davies intercepted Roger Wilson’s pass behind a scrum to race clear and go under the posts to seal the victory.
Scorers for Scarlets: Tries: J Davies. Conv: Priestland. Pens: Priestland (5).
Scorers for Ulster: Tries: Cave, Conv: Humphreys Pens: Pienaar (2).
SCARLETS: L Williams (S Shingler 67); K Phillips, R King (H Parkes 67), S Williams (capt), M Tagicakibau; R Priestland, R Williams (A Davies 54), R Evans, E Phillips, S Lee, G Earle, J Snyman, A Shingler, J Davies, R McCusker.
ULSTER: L Ludik; T Bowe, D Cave, L Marshall, C Gilroy; I Humphreys, R Pienaar; C Black, R Best (capt), D Fitzpatrick; D Tuohy, F van der Merwe; R Diack, C Ross (B Ross 66), R Wilson.
Yellow card: Fitzpatrick
Referee: JP Doyle (RFU).