Gloucester earned a place in the second-tier Amlin Challenge Cup quarter-finals as they won at Perpignan to secure second place in Pool Six of the Heineken Cup.
Gloucester took a 12-10 lead through tries from Jonny May and Shane Monahan.
Charlie Sharples' converted score put them 19-10 ahead at the break.
Monahan crossed for Gloucester's fourth to secure the bonus point and although Karl Chateau replied, there was still time for Ben Morgan to add a fifth try.
The Heineken Cup knockout stages had long since disappeared over the horizon for Gloucester and pool winners Munster's 38-6 win over Edinburgh saw them secure a home semi.
However, thanks to the convoluted system currently in place in Europe, Gloucester could still reach the Amlin Challenge Cup last eight as one of the third to fifth best-placed runners-up in the top tier competition.
Matt Kvesic made a nuisance of himself at the breakdown and Freddie Burns overcame a shaky start to suggest he may be returning to form, while England squad man Jonny May was a constant threat at outside centre in broken play.
The 23-year-old, normally a winger but moved inside by Gloucester in the past couple of games, scored the visitors' first try, picking up a Perpignan knock-on and beating three men on a weaving 60m gallop to the line.
It took a superb turnover a metre out by the Gloucester forwards to prevent the hosts driving over but little more than a minute later Sione Piukala cut a slashing line off David Marty's pass and the Tongan sliced past May to score a fine try of his own.
Tom Ecochard converted to add to an earlier penalty and give the hosts a 10-5 lead but Gloucester then took control.
Blind-side Matt Cox burst round the fringes of a ruck and, when he was hauled down a metre short, the visitors spun it wide and May linked with full-back Rob Cook to give Irish winger Monaghan the chance to step inside Watisoni Votu and score.
Burns converted to put Gloucester back in front and they soon added a second spectacular counter-attacking score.
Billy Twelvetrees' wide pass gave number eight Gareth Evans the chance to stride 50m and he drew the full-back before passing inside to Sharples, who went over despite Tommaso Benvenuti's tackle.
Burns converted to make it 19-10 at the break and although Ecochard landed a difficult penalty immediately after the restart, Gloucester then pulled away.
The youthful visiting backs were looking lively but it was a good drive from the improved forwards that enabled scrum-half Dan Robson to put Monahan over down the blind-side for another converted score.
As Perpignan fell further behind on the scorecard, tempers began to flare and Gloucester looked as though they would face a nervous last 20 minutes as Chateau went over just after the hour.
But the hosts lost replacement prop Giorgi Jgenti to the sin bin for throwing a couple of wild but ineffective punches at lock Will James.
And Burns popped over a drop-goal to calm Gloucester nerves before England number eight Morgan profited from a dominant five-metre scrum as the visitors finished in style.
Gloucester boss Nigel Davies: "It's an exceptional result for us. The last time we won an away game in France in the Heineken Cup was the 2007-08 season. Not many sides come away with a win here but we've managed it with a bonus point.
"Jonny May's got those moments in him and every team needs players like that, players who can finish a half chance or create something from nothing.
"We knew if we could turn them over we could cause them problems and he's a superb finisher."
Perpignan: Michel; Benvenuti, Marty, Piukala, Votu; Guitoune, Ecochard; S Taofifenua, Terrain, Ion, Leo, R Taofifenua, Purll, Narraway, Chateau, Durand.
Replacements: Durand for Michel (53), Mafi for Guitoune (60), Taumalolo for S. Taofifenua (47), Delonca for Terrain (63), Jgenti for Ion (47), Perez for Leo (53), Torfs for Durand (76).
Not Used: Strokosch.
Sin Bin: Jgenti (77).
Gloucester: Cook; Sharples, May, Twelvetrees, Monahan; F Burns, Robson; Y Thomas, Edmonds, Puafisi, Stooke, Hudson, Cox, Kvesic, G Evans.
Replacements: Cowan for Robson (65), Murphy for Y Thomas (59), George for Edmonds (52), Knight for Puafisi (60), James for Hudson (64), Kalamafoni for Cox (52), B Morgan for G Evans (65).
Not Used: M Thomas.
Ref: George Clancy (Ireland).