Gloucester are through to the last 16 of the Heineken Champions Cup with victory over Bordeaux Begles.
Their win in France, along with a loss for Racing 92 at Leinster, was enough for the Cherry and Whites to squeeze into a top-eight spot in Pool A.
Gloucester trailed 10-0 early on but enjoyed the better of the match for long spells and, aided by opposition indiscipline, completed a deserved win.
George McGuigan, with two, and Albert Tuisue were the visitors' try scorers.
Gloucester's positive start was not replicated by the scoreline as Bordeaux, who began the match knowing they could not qualify for the knockout phase, raced into an early lead.
Stephen Varney had already made a try-saving tackle on Madosh Tambwe before Matthieu Jalibert collected a high kick inside his own half, jinked his way past a Gloucester tackler and started the move that sent scrum-half Jules Gimbert clear down the right touchline for the game's first try.
The visitors were finally rewarded for their attacking pressure when hooker McGuigan, one of five uncapped players named in Steve Borthwick's England squad for the Six Nations this week, finished off a drive from a line-out.
Home captain Mahamadou Diaby and prop Ugo Boniface were both shown yellow cards within a two-minute spell, but Gloucester wasted several chances to score against 13 men either side of half-time until number eight Tuisue broke from the back of a scrum to put the visitors in front for the first time.
That setback briefly sparked Bordeaux Begles into life and Boniface replied almost immediately, burrowing over from a yard, before more indiscipline and numerous errors proved their undoing.
George Barton kicked three penalties while Jalibert was in the sin-bin to restore Gloucester's advantage, which was not relinquished and was stretched further when McGuigan rumbled over from another line-out.
"I'm immensely proud because Bordeaux don't lose very often here," said Gloucester head coach George Skivington.
"We knew it was going to be a massive challenge but I thought the resilience the boys had when it wasn't going our way to solve the problems was excellent.
"To come to France to play and beat a fully-loaded Bordeaux, a side who have had some good results in their league in the last few weeks, was a big step forward for us as a group."
Line-ups
Bordeaux-Begles: Ducuing, Cordero, Uberti, Moefana, Tambwe, Jalibert, Gimbert; Boniface, Sa, Falatea, Jolmes, Cazeaux, Miquel, Diaby (c), Timu.
Replacements: Lamothe, Poirot, Vaotoa, Marais, Vergnes, Zabalza, Garcia, Dubie.
Gloucester: Barton, May, Kveseladze, Atkinson, Thorley, Twelvetrees, Varney; Rapava Ruskin, McGuigan, Gotovtsev, Jordan, Alemanno, Clement, Ludlow (c), Tuisue.
Replacements: Blake, Elrington, Ford-Robinson, Clarke, Thomas, Chapman, Reeves, Evans.
Referee: Frank Murphy (Ireland)