Edinburgh's hopes of Heineken Cup glory were handed a huge boost as they returned to winning ways on Friday night.
The Scottish capital outfit face four-time European Kings Toulouse at Murrayfield next Saturday afternoon as they look to reach the semi-final stages for the first time in their history.
Edinburgh surged through to the last eight thanks to five wins from six Heineken Cup group games but their form on the domestic stage has been less impressive.
Michael Bradley's men had lost their last seven league games prior to the RaboDirect PRO12 encounter with the Scarlets but a penalty try and a Dave Denton effort finally saw them end that frustrating run.
The home side led 20-6 at the interval as they showed glimpses of the form that had seen them beat Racing Metro, London Irish and Cardiff Blues to top Pool 2.
A second-half fightback from the Scarlets tested Edinburgh's nerve but they eventually secured a morale-boosting victory even though Jonathan Davies and Andy Fenby scores had brought the Welsh side level at 23 all with 14 minutes still remaining.
In the end it was a 73rd minute penalty from Greig Laidlaw that sealed the points for Edinburgh who now turn their attentions to one of the biggest challenges in European club rugby.
Head coach Bradley, said: "It builds well for next weekend, as we have the win, but there's still plenty to work on. It was great to get back to a dressing room and have a win. We had a very good first-half and a nervous second, but it was great to get there in the end.
"It was always going to be a tough game against a high-flying and very strong Scarlets side. We showed a lot of character to get the win."
The Scarlets are also in European action next week as they look to bounce back from this defeat with a memorable win at Brive in the Amlin Challenge Cup quarter-finals.
The Heineken Cup Pool 1 runners up had hoped to travel to France on the back of successive league victories having won away at Cardiff Blues last weekend but they will still be confident of repeating their 2010 success over the same opposition at the Stadium Municipal.