Edinburgh closed the gap on the Scarlets to four points in the PRO14 Conference B as they clinched a 25-12 victory over the Dragons.
The Scottish capital club seemed to be cruising when tries from hooker Neil Cochrane and centre Chris Dean helped to put them 15-0 ahead in the opening stages of the second half.
Two tries from Dragons second row Rynard Landman threatened a comeback but Duncan Weir's touchdown and fellow replacement Cameron Fenton's last-gasp effort gave Edinburgh a bonus-point win.
Edinburgh, who were looking to back up a late win over Ulster with victory in Wales, hit the ground running, with Sam Hidalgo-Clyne booting a 20-metre penalty inside six minutes.
It was the Dragons' first league match at Eugene Cross Park and they had to wait until the 19th minute for a first chance at points as fly-half Dorian Jones tried a 35-metre drop goal that sailed wide.
And Edinburgh increased their lead when captain Fraser McKenzie took a line-out ball five metres from the home line. Cochrane came into the rear of the driving maul and easily touched down, with Hidalgo-Clyne adding the extras.
The Dragons were their own worst enemies at times, with a clearance charged down too quick for flanker Magnus Bradbury to touch down, while passes flew into empty spaces with the home side scrambling to recover.
The visitors' pack worked well, with Fijian number eight Bill Mata's charges causing headaches through the home midfield.
Edinburgh extended their lead minutes into the second half when pressure inside the home 22 saw Dean in space to run over on the right.
Hidalgo-Clyne failed with a long conversion but the Scottish region looked on course to put pressure on the Scarlets at the top of the Conference table.
But the Dragons hit back with a rare excursion on to the Edinburgh line as giant lock Landman finished off a series of drives to cross. Jones converted from the 22-metre line and, suddenly, the Dragons were back in the match.
Edinburgh regrouped and tried to keep the match tight, playing it through their pack.
However, they were caught on the hop when Jones found a lovely gap through the Scotsmen's midfield and dashed from the visitors' 10-metre line almost to their try line on the right before shipping the ball to Landman to score in the corner.
The Dragons were just three points adrift, but, for a second successive week, Weir, who scored a last-gasp drop goal for victory over Ulster, grabbed a crucial score and Fenton was driven over for the fourth bonus touchdown in the dying seconds.