|Pro14: Cardiff Blues v Edinburgh|
|Cardiff Blues: (3) 34|
|Tries: Belcher, Lee-Lo, J Evans, Ratti Cons: J Evans 4 Pens: J Evans 2|
|Edinburgh: (10) 15|
|Tries: Taylor 2 Con: Savala Pen: Savala|
Cardiff Blues' thrilling second-half comeback sealed fourth place in Pro14 Conference B and kept their Heineken Champions Cup qualification hope alive.
The first of George Taylor's two tries gave Edinburgh a 10-3 half-time lead.
But Liam Belcher, Rey Lee-Lo, Jarrod Evans and James Ratti crossed for Blues to claim all five match points.
Scarlets' win over Connacht means Blues must settle for fourth and Edinburgh fifth, with the Scottish side now likely to be in the Challenge Cup.
Blues began the game - their last of the regular season - knowing they had to beat Edinburgh to keep alive their hope of a qualifying spot for next season's Champions Cup.
While the Scottish side boast two games in hand, they travelled to Wales seven points behind their hosts.
Qualification for next season's European competitions has not yet been finalised, but finishing in the top three of either Pro14 conference guarantees an automatic place in the top-tier Champions Cup.
Blues might still be granted a place as of right, although it is more likely they would face a qualification play-off if that pathway is decided upon.
Qualification play-offs are unlikely to extend to the teams in fifth place or lower, so Edinburgh are likely to have to settle for the second-tier Challenge Cup.
Scottish side controls opening half
After weathering early Edinburgh pressure, Jarrod Evans had the first chance of the game to score but the Blues fly-half could only hit the post with a relatively easy penalty.
Instead the visitors took the lead through stand-off Charlie Savala, the 20-year-old making no mistake with his first kick on his Edinburgh debut.
Evans made amends with his next opportunity to level, but Edinburgh hit back when centre Taylor finished off a flowing move, straightening the line to surge over.
Savala converted but could not add a late penalty in the first half and Edinburgh had to settle for a 10-3 lead at the break.
Blues started the second half brightly with full-back Matthew Morgan again to the fore in attack.
That earned an early penalty for Evans to reduce the gap before the home forwards took over, shoving hooker Belcher over the line from close range for a converted try that retook the lead.
Blues' purple patch continued with Morgan again making the break that led to their second try, centre Lee-Lo applying the finishing touch after good work from Ben Thomas.
Evans added the tricky afters for a 20-10 lead with just over quarter of the match remaining.
The second-half drama continued as Taylor claimed his and Edinburgh's second try of the evening, although crucially replacement Jack Blain could not add the conversion.
Evans was just wide with a long-range penalty that would have left Edinburgh needing two scores, but moments later the fly-half touched down under the posts - converting himself - after gathering a clever Lloyd Williams chip.
Edinburgh hopes were finished off as the Welsh side claimed a bonus-point try and sealed victory when replacement Ratti went over in the final moments.
Home captain Josh Turnbull was named player of the match.
Cardiff Blues director of rugby Dai Young told BBC Sport Wales:
"Two weeks on the bounce we've turned it round after a very similar performance in Treviso, a very mixed bag first half and then went up a few gears- really pleased with the second half when I thought we were excellent.
"We were keeping an eye on the Scarlets but it's not about today. It's undecided whether three or four go through (to the Champions Cup) but if we don't go through we have to look at some of the performances leading up to the last couple of weeks.
"It's a good way to finish, hopefully it's enough but if it isn't we've got to look at improving next season."
Edinburgh head coach Richard Cockerill said:
"The score didn't reflect the endeavour we put in but Cardiff had a great second half and we just couldn't cope physically. The team worked hard and stayed in the game but we just weren't good enough in the end.
"We lost players to injury and we already had guys missing (11 with Scotland).
"Ultimately you get what you deserve and we haven't been good enough over the season,we haven't had our international players for two-thirds of the season.
"We're a small squad with a small budget losing 12, 13, 14 players and you have to deal with the reality of it, so we'll regroup and have another bash at it next season."
Cardiff Blues: Matthew Morgan; Jason Harries, Rey Lee-Lo, Ben Thomas, Aled Summerhill; Jarrod Evans, Lloyd Williams; Rhys Gill, Liam Belcher, Dmitri Arhip, Seb Davies, Rory Thornton, Olly Robinson, Ellis Jenkins, Josh Turnbull (capt).
Replacements: Kristian Dacey, Rhys Carré, Dillon Lewis, James Ratti, Alun Lawrence, Lewis Jones, Max Llewellyn, Hallam Amos.
Edinburgh: Damien Hoyland; Blair Kinghorn, James Johnstone, George Taylor, Eroni Sau; Charlie Savala, Charlie Shiel; Boan Venter, Mike Willemse, Lee-Roy Atalifo, Magnus Bradbury, Andrew Davidson, Mesu Kunavula, Luke Crosbie, Viliame Mata.
Replacements: Sam Kitchen, Murray McCallum, Angus Williams, Jamie Hodgson, Ally Miller, Henry Pyrgos, Jack Blain, Mark Bennett.
Referee: Nigel Owens (WRU)
Assistant referees: Adam Jones, Wayne Davies (both WRU)
TMO: Rhys Thomas (WRU).