An Aled Gravelle try gave the visitors the advantage, but Dan Parks's 12 points edged the home team ahead at Firhill. A Jon Petrie try took them clear and as the Scarlets fought back Wales number eight Alix Popham was sent off for disputing a poor refereeing decision.
Consolation for the visitors came with a bonus point that guarantees them Heineken Cup rugby next season. They cannot now be overtaken by the Dragons, who will face a play-off with the third-best Italian team for the final European slot if they fail to overhaul the Ospreys.
The visitors took the early advantage in the game with a Craig Evans penalty, but lost the initiative when Popham was sin-binned for a high and dangerous tackle on Fergus Thomson. Parks landed the resultant penalty, and added a second with Popham still cooling his heels. The Glasgow fly-half missed with two other chances in a dire first half, though, leaving it at 6-3 at the break.
The Scarlets made a more promising start to the second period, replacement Paul Mackey impressing. With the line at the Welsh side's mercy, Glasgow centre Andrew Henderson came in from an offside position and was punished with a yellow card. The visitors went for the jugular with a series of scrums, before eventually releasing to the backs.
Recycled ball was sent wide by Dwayne Peel, hooker Gravelle receiving in midfield and showing the nous to throw a dummy past Colin Gregor for the opening try. Sloppy forward work from the Scarlets gave Parks a further two penalties, though, as the home side regained the lead.
The Scarlets then blew the restart, giving Glasgow the platform for a swift attack up the centre of the field. Their forwards recycled quickly and fed Parks, who put flanker Petrie clear in the corner.
Regan King and Dafydd Jones combined to spark a fine Scarlets attack, ended when a sniping Peel was held up over the try line. From the scrum five Popham appeared to control the ball perfectly at his feet, but referee George Clancy ruled that it had come out, allowing Glasgow to steal possession.
Popham reacted with an angry gesture and comment aimed at Clancy, leading to a sending off for a second yellow-card offence, a decision that could affect his hopes of touring with Wales to Argentina next month. The under-strength Scarlets bravely came back at Glasgow, but the Scots had enough to hold on and end a six-game Celtic League losing streak.
Borders' loss at Ulster means that Scotland's second and final Heineken Cup qualifiers will be decided on a tense final weekend of action.
Try: Jon Petrie
Penalties: Dan Parks (4)
Try: Aled Gravelle
Conversion: Craig Evans
Penalty: Craig Evans