A last minute penalty from Rhys Patchell saw Cardiff Blues come from 6-17 down to beat the Dragons 21-20 at Rodney Parade on Sunday.
A try from Ashton Hewitt helped the Newport-based side take the early initiative as they went into half-time holding an 11-6 lead.
Then after the break two penalties from the boot of Dorian Jones meant that the hosts held an 11 point lead with 20 minutes to go.
The match was turned on its head when Cardiff Blues were awarded a penalty try which also resulted in a yellow card for the Dragons' Lewis Evans. While Evans was in the sin bin, Tom James scored a try for the Blues which drew them close but Patchell missed the conversion which would have seen them level.
Patchell went from zero to hero with a last ditch penalty for the Blues which saw them secure just their second PRO12 win of the season. It takes them into ninth place in the table while the Dragons slip below them to tenth.
A drop-goal from Jones gave the Dragons an early lead in the sixth minute. This lead was extended in the ninth minute with Hewitt going over in the corner to give the hosts an eight point advantage.
Patchell kicked a penalty for Blues in the 13th minute after Adam Hughes was penalised for tackling a man without the ball. Fly-half Patchell added a second penalty in the 22nd minute to cut the gap to two points.
Jones doubled his personal tally for the match just before half-time with a penalty which took the home side into an 11-6 lead at the interval.
Jones repeated his feat two minutes after the break, scoring another penalty to establish an eight point advantage.
The Dragons extended their lead with another penalty from Jones on the hour mark, taking the score to 17-6.
Cardiff Blues were awarded a penalty try in the 65th minute following an infringement by Evans, who was shown a yellow card. Patchell kicked the extras to bring his side to within four points of the hosts.
The match sprung into life with ten minutes to go. Firstly, Jason Tovey scored a penalty for the hosts as they hit the 20 point mark. This was before James found a gap in the Dragons' defence to cross for the Blues' second try of the match.
Patchell had the chance to draw the visitors level with his conversion but it was pushed just wide by the fly-half.
However, in enthralling fashion the 22-year-old made amends, scoring a last minute penalty to clinch victory.
Pen: Jones 3, Tovey
Yellow: L Evans (67 mins)
For Cardiff Blues:
Tries: Penalty, James
Pen: Patchell 3
Dragons: 15 Carl Meyer, 14 Nick Scott, 13 Adam Hughes, 12 Adam Warren, 11 Ashton Hewitt, 10 Dorian Jones, 9 Sarel Pretorius, 8 Lewis Evans, 7 Nic Cudd, 6 Nick Crosswell, 5 Rynard Landman, 4 Matthew Screech, 3 Brok Harris, 2 Thomas Rhys Thomas (c), 1 Phil Price.
Replacements: 16 Elliot Dee, 17 Boris Stankovich, 18 Lloyd Fairbrother, 19 Cory Hill, 20 Ollie Griffiths, 21 Luc Jones, 22 Jason Tovey, 23 Ross Wardle.
Cardiff Blues: 15 Rhys Patchell, 14 Alex Cuthbert, 13 Garyn Smith, 12 Rey Lee-Lo, 11 Tom James, 10 Jarrod Evans, 9 Lloyd Williams, 8 Manoa Vosawai, 7 Josh Navidi, 6 Josh Turnbull, 5 James Down, 4 Lou Reed, 3 Taufa'ao Filise, 2 Kristian Dacey, 1 Gethin Jenkins (c).
Replacements: 16 Ethan Lewis, 17 Sam Hobbs, 18 Dillon Lewis, 19 Macauley Cook, 20 Cam Dolan, 21 Tavis Knoyle, 22 Cory Allen, 23 Dan Fish.
Referee: Ian Davies (Wales)
Assistant Referees: Neil Hennessey (Wales), Sean Brickell (Wales)
TMO: Gareth Simmonds (Wales)