A half-time rocket from coach Richard Cockerill inspired Edinburgh to an incredible second-half blitz in Wales that rescued them from 12 points down to beat the Scarlets and keep their hopes of reaching the Guinness PRO14 knockout stage alive.

"I was a bit disappointed with the first half and we had a few tough words," Cockerill said. "The reaction, to be fair, and to win that second half 20 to zip is a massive half of rugby for us. We are not used to being that resilient, coming back and getting those big wins.

"There was a bit of shouting and encouragement at half time about what we are about – that was not Edinburgh rugby in the first half, not who we want to be known for. Having had a big week last week and a game we could have won, to go to that first half was pretty disgusting from us.

"That second half was the complete opposite but what we won't do is paper over the first half with the second. I am happy that we have got the win because it is a huge, huge result."

The sides had come into the game with only two points separating them as both tried to mount a late-season charge for the knockout stages with the hope of a consolation prize of a Heineken Champions Cup play-off if they fail narrowly.

Edinburgh had stuck close to the side that nearly took them to the Heineken Cup quarter-finals the week before, the only planned change being the introduction of Mark Bennett at centre though they also had to make a late change with Chris Dean failing a fitness test and being replaced by Matt Scott – restoring the old Scotland midfield.

Not that the unit looked Test class as Leigh Halfpenny came early on an inside line off Dan Jones, his fly-half, to carve the Scots defence open and set Gareth Davies up for the try that gave the Welsh an early lead.

The big problem for Edinburgh, however, was that they were struggling to hang on to the ball – it was 21 minutes before Viliame Mata made one of his trademark carries, for example.

The tricky position was soon worse when a quick drop out caught Edinburgh napping and slick handling down the back division sent Steff Evans, the wing, clear to draw the final defender and put Jonathan Davies, the centre, in for the second try.

When Edinburgh could get their forwards involved, they did start to look the part with a driving maul just before half time ending when it was illegally pulled down and Ken Owens, the Scarlets captain, was sent to the sin-bin.

Jaco van der Walt, the fly-half, missed the penalty, and they made for the dressing room without a point on the board and their coach seething.

His message worked and after van der Walt had landed a shot a goal soon after the teams returned to the pitch, there was dramatic change in the shape of the game, with Hamish Watson peeling off the back of a maul and finding a huge gap for Matt Scott to score and get his side into the game.

That soon became the kind of lead that had looked only a distant dream in the first half as van der Walt intercepted a pass from Halfpenny and ran in for the score with his conversion and a second penalty easing his side into an eight point lead.

Cockerill said: "They are a good side, that backline is a dream backline for anybody, they are a threat every time they have the ball. They hurt us in the first half as we used a lot of energy defending so we did not seem to have any energy when we had the ball. Small moments.

"We have won nothing, qualified for nothing. We are happy with the result because it is a big, big result for us as a club, this is a very hard place to come and win but we have won nothing and done nothing. We still have Ulster, who are a very good side and Glasgow."

Scorers: Scarlets: Tries: G Davies, J Davies. Con: Halfpenny.

Edinburgh: Tries: Scott, van der Walt. Cons: van der Walt 2. Pen: van der Walt 2.

Scarlets: L Halfpenny; J McNicholl, J Davies, H Parkes (K Fonotia, 76), S Evans (I Nicholas, 65); D Jones, G Davies; R Evans (W Jones, 65), K Owens (C) (sin bin: 37-47, M Jones, 29-35), S Lee (W Kruger, 57), L Rawlins (J Macleod, 76), S Cummins (J Helps, 41), W Boyde, J Davies, U Cassiem.

Edinburgh: D Graham; D Hoyland, M Bennett, M Scott , D van der Merwe; J van der Walt, H Pyrgos; P Schoeman (R Sutherland, 76), S McInally (C) (R Ford, 73), WP Nel (S Berghan, 45), B Toolis, G Gilchrist, J Barclay (M Bradbury, 41), H Watson, V Mata.

Referee: G Clancy (Ireland)

Attendance: 8,733