Gloucester produced an outstanding display but fell agonisingly short of upsetting holders La Rochelle in the last 16 of the Heineken Champions Cup.
Defensively resolute and attacking with freedom throughout, Gloucester led by four points with four minutes left.
But Teddy Thomas went over in the corner for his second try to ensure the French side progressed to the quarter-finals.
Ronan O'Gara's team will face Saracens or Ospreys in the last eight.
Chris Harris and Freddie Clarke went over for Gloucester in a first half that ended level at 15-15.
After falling seven points behind early in the second period, Louis Rees-Zammit's try and two Billy Twelvetrees penalties put the Cherry and Whites on the brink of a famous victory.
The hosts were roared on during a spell of sustained pressure near Gloucester's try-line and eventually spread the ball wide for Thomas to score the match-winning try.
Gloucester come so close to famous upset
Before kick-off not many gave Gloucester, currently ninth in the Premiership after three consecutive league defeats, much chance of beating the champions on French soil.
However, hopes of an upset quickly grew when the Cherry and Whites worked the ball infield from a line-out and centre Harris darted through a gap for the opening try.
Hooker Pierre Bourgarit responded from close range and Thomas wrested the ball from Gloucester hands to give La Rochelle the lead, but Gloucester lock forward Clarke produced an acrobatic finish in the corner - more reminiscent of a winger than a second-rower - to restore parity.
The visitors could have led at the interval, but a Santi Carreras effort was ruled out after the officials deemed that Rees-Zammit pushed Greg Alldritt in the back as the hosts' number eight attempted to field a loose ball on the ground.
Gloucester could easily have crumbled when captain Lewis Ludlow was sin-binned early in the second period for illegally halting a maul, after which home scrum-half Tawera Kerr-Barlow sniped over from close range.
But back came Gloucester, making light of their one-man disadvantage to score their third try when Wales winger Rees-Zammit advanced on to Twelvetrees' high kick and touched down.
A successful Twelvetrees penalty gave Gloucester a one-point lead and he extended that to four after La Rochelle replacement Georges-Henri Colombe's yellow card for a dangerous tackle on Ruan Ackermann.
But the English side were left distraught at full-time after Thomas had confirmed their exit from the competition.
Skivington 'devastated' as Gloucester eliminated
Gloucester head coach George Skivington told BBC Radio Gloucestershire:
"The boys were brave in the way they attacked the game, they made the right decisions and put pressure on them at the right times.
"This is a serious outfit; these are the European champions and the budgets would blow your mind in comparison.
"Tonight we showed some proper grit and played smart rugby. I'm absolutely devastated for everybody, all the players, staff and Gloucester supporters, because I think we deserved to get through that round."
Line-ups
La Rochelle: Dulin; Thomas, Rhule, Danty, Favre; Hastoy, Kerr-Barlow; Sclavi, Bourgarit, Atonio, Lavault, Skelton, Dillane, Botia, Alldritt (c).
Replacements: Lespiaucq, Wardi, Colombe, Sazy, Tanga, Boudehent, Berjon, Reus.
Gloucester: Carreras; Rees-Zammit, Harris, Atkinson, Thorley; Twelvetrees, Varney; Vivas, Blake, Gotovtsev, Clarke, Alemanno, Ackermann, Ludlow (c), Clement.
Replacements: Walker, Elrington, Ford-Robinson, Jordan, Thomas, Morgan, Chapman, May.
Referee: Mike Adamson (Scotland)