Gloucester rallied in the second half to beat Cardiff 46-26 in a thrilling European Challenge Cup quarter-final at Kingsholm.
At one stage, Gloucester trailed 26-20 but three converted tries in 13 minutes crushed the visitors and sent the home side through to a semi-final at high-flying La Rochelle.
Tom Marshall scored two tries for Gloucester, with Jonny May, Ross Moriarty, Henry Purdy and Mark Atkinson one apiece. Billy Twelvetrees converted four of them with Billy Burns adding a penalty and conversion.
Alex Cuthbert scored Cardiff's two tries. Steve Shingler converted both and kicked three penalties while Gareth Anscombe dropped a goal.
The visitors made a strong start to take a fifth minute lead. A poor kick from Burns saw the visitors counter-attack in style before Cuthbert forced his way over from close range.
The frenetic opening continued with Gloucester drawing level after 10 minutes. Richard Hibbard was tackled 25 metres out from the Blues' line by Kristian Dacey and the ball went loose for Moriarty to collect and power past a weak tackle from Matthew Morgan to score.
Burns converted and exchanged penalties with Shingler to make it 10-10 at the end of the first quarter.
Morgan almost atoned for his error by making a scintillating break before feeding Lloyd Williams - but the scrum half lacked the pace to make the line as he was brought down by an excellent cover tackle from Twelvetrees.
However from the resulting scrum, Blues regained the lead when Shingler kicked his second penalty after the hosts had infringed - but the advantage was short-lived as Twelvetrees kicked a simple penalty.
Twelvetrees had taken over the kicking duties after Burns had departed following a heavy challenge and the British Lions player continued to make an impact by creating the next Gloucester score.
From a line-out in the visitors 22, Twelvetrees rounded Shingler to send Marshall over before the see-saw first half continued with a second try for Cardiff.
The visitors declined a couple of kickable penalties in favour of more attacking options and when Gloucester prop Josh Hohneck, was yellow carded they took advantage when a clever pass from Anscombe sent Cuthbert over for his second try.
With a minute of a pulsating first half remaining, Anscombe dropped a goal to leave his side 23-20 ahead at the interval.
Soon after the restart, Gloucester returned to 15 men but it made little difference as the Welsh region continued to be the better side and went further ahead with another Shingler penalty.
Another error from Matthew Morgan put Gloucester back in the game. The full-back lost possession in his own 22 and the hosts utilised the platform when May collected a well-judged crossfield kick from Twelvetrees to score. with a touchline conversion from Twelvetrees putting his team 27-26 in front.
Morgan was immediately replaced by Willis Halaholo but the home side extended their lead when a splendid Will Heinz break set up a second try for Marshall.
Gloucester were now firmly in control as their opponents wilted, with Atkinson and Purdy scoring late tries to confirm the hosts' place in the last four.