Gloucester edged to a last-gasp win over Ulster in an entertaining and fractious affair to boost their hopes of progressing in the Champions Cup.
George Barton crossed with the clock having ticked beyond 80 minutes to seal a dramatic victory and a bonus point.
Ulster, at one time down to 13 men, received three yellow cards and Gloucester one as three penalty tries were awarded at Kingsholm.
The visitors had scored 24 unanswered points before the hosts fought back.
Gloucester led at the break through Louis Rees-Zammit's score and a penalty try, either side of a Billy Burns try, with Mark Atkinson crossing in the second half.
Michael Lowry crossed for the visitors who, after Rees-Zammit was yellow carded, levelled with a penalty try before John Cooney looked to have completed the revival.
But a late penalty try brought Gloucester within three points and Barton raced in at the death to win it for the hosts.
With both sides having lost their opening games in Pool B, Gloucester move on to five points while Ulster have three.
Burns returns but Gloucester snatch it
All eyes were on the two number 10s, after Danny Cipriani's midweek departure from Kingsholm, and with Ulster captain Burns returning for the first time since leaving Gloucester in 2018.
Gloucester head coach George Skivington said fly-half Cipriani's exit was "not ideal timing", but it presented an opportunity for Lloyd Evans.
The 25-year-old delivered an assured performance and kicked well, converting from wide out after Rees-Zammit squeezed over in the corner early on.
Burns, who scored 304 points in 101 appearances for the Cherry and Whites before making the switch to Ulster, stepped through the Gloucester line to level against his former club after a spell of pressure from the visitors.
But it was Evans who kicked a penalty to nudge Gloucester back in front and the visitors were soon down to 13 men.
Forwards Rob Herring and Alan O'Connor were sin-binned in quick succession for bringing down mauls, with Gloucester awarded a penalty try for the second infringement.
Despite their numerical disadvantage, Ulster closed the deficit to seven points before the break thanks to Cooney's penalty.
The scrum-half had a chance to add another three points from just inside his own half but, having tried to run down the clock, the ball slipped from the tee and he had no time to reset.
The sides exchanged early scores in the second half as Atkinson dropped over from the back of a rolling maul before a smart Ulster move allowed full-back Lowry to cross.
Ulster pulled level once more thanks to a penalty try after an illegal intercept from Gloucester winger Rees-Zammit and the visitors went in front for the first time when Cooney, having wasted an earlier attempt, kicked a penalty from 45 metres out.
The scrum-half then raced clear to secure Ulster a bonus point, but the drama was not over yet.
A penalty try and yellow card for Ulster's Ethan McIIroy set the foundations for late Gloucester pressure and 20-year-old Barton made it count to the delight of the home crowd.
Line-ups
Gloucester: Moyle; Sharples, Harris, Atkinson, Rees-Zammit; Evans, Chapman; Rapava-Ruskin, Singleton, Knight, Slater, Alemanno; Reid, Ludlow (capt), Ackermann.
Replacements: Walker, Seville, Ford-Robinson, Craig, Nagle-Taylor, Venner, Barton, Trinder.
Sin Bin: Louis Rees-Zammit.
Ulster: Lowry; Faddes, Hume, McCloskey, Stockdale; Burns (capt), Cooney; O'Sullivan, Herring, Moore, A O'Connor, D O'Connor; Reidy, Murphy, Timoney.
Replacements: Andrew, McCall, O'Toole, Rea, Jones, Mathewson, Madiagn, McIlroy.
Sin Bin: Herring, O'Connor, Ethan McIIroy.