Gloucester's Heineken Cup quarter-final hopes were left hanging by a thread after underdogs Edinburgh stunned them at Kingsholm.
Edinburgh had lost nine of their previous 10 games in Europe, but centre Ben Atiga's second-half try and 11 points from the boot of full-back Jack Cuthbert left Gloucester reeling.
It means the west country club are five points behind Pool Four leaders Munster before they host the Irish heavyweights next month, with Edinburgh and Perpignan likely to be scrapping for minor placings.
Gloucester's erratic Aviva Premiership form surfaced at exactly the wrong time on a European stage as they struggled to subdue an Edinburgh outfit high on commitment and endeavour.
Gloucester claimed a 35th-minute penalty try converted by fly-half Freddie Burns, who also kicked a penalty, but they could have few complaints over a 16-10 loss as Edinburgh posted a first Heineken away win since they toppled Racing Metro in January 2012.
And Munster were the beneficiaries, opening up a sizeable advantage at the Pool Four summit, knowing that one victory from their last two games - the final one being at home to Edinburgh - should be enough to guarantee quarter-final status.
Gloucester, though, were once again left to reflect on their failure to deliver a performance when it really mattered after putting themselves in contention by beating Edinburgh at Murrayfield last weekend a month after toppling Perpignan.
Edinburgh made a composed start in miserable conditions, despite finding themselves under early scrum pressure, and former Bath back Cuthbert opened their account with a ninth-minute penalty.
Burns had a chance to land an equalising strike three minutes later, but his kick drifted wide on the wind and Edinburgh preserved their advantage in a game when set-piece stability and tactical accuracy were key ingredients.
Gloucester dominated possession, using powerful ball-carriers like England number eight Ben Morgan to drive deep into Edinburgh territory, but they also had to show patience against a well-organised defensive outfit.
Cuthbert then extended Edinburgh's advantage through a long-range penalty that went over after bouncing off the crossbar before Burns departed for treatment to a facial cut that required seven stitches.
Referee Romain Poite warned rival hookers Darren Dawidiuk and Ross Ford in an attempt to resolve scrummaging difficulties on both sides, and Gloucester finally opened their account five minutes before half-time.
The home forwards relentlessly drove a maul from just inside Edinburgh's 22, and after the visitors threw bodies in to try to illegally halt it, Poite awarded a penalty try.
Burns added the conversion, but Edinburgh had enough time to regain an advantage as another Cuthbert penalty completed his penalty hat-trick and gave the visitors a 9-7 lead.
Errors abounded from both teams, which was no surprise given the elements, yet Edinburgh retained a healthy appetite for the battle and they stunned Gloucester with a 50th-minute try after a Burns penalty had edged his team in front.
Edinburgh's forwards laid the platform as several passages of play put Gloucester on the back foot, and it resulted in quickly recycled possession allowing a simple score for Atiga.
Cuthbert added the extras, leaving Gloucester 16-10 adrift and chasing a game they knew could not pass them by in pursuit of a prized last-eight spot.
Their task was helped midway through the second period when Edinburgh prop Willem Nel received a yellow card after Poite's patience ran out at scrum time, and Gloucester immediately surged upfield.
Temporarily a man down, Edinburgh were forced into a prolonged defensive rearguard, but they survived as Gloucester's attacking deficiencies were exposed and Poite's penalty count began to mount up against the home side.
Gloucester suffered an injury blow when flanker Sione Kalamafoni was carried off 12 minutes from time, and then his back-row partner Morgan was sin-binned following a lineout infringement.
It meant that Gloucester were guaranteed to finish the game with 14 men, summing up a damaging afternoon that left them realistically facing a Heineken pool stage exit.
© Press Association