Bristol Bears extended their lead at the top of the Premiership to six points with a tense 18-17 win in the West Country derby at Gloucester.
Bears' Bryan Byrne and Jake Heenan crossed either side of two first-half Santiago Carreras intercept tries.
Ollie Thorley finished to put the hosts ahead in the 53rd minute.
But two late Ioan Lloyd penalties gave Bristol a one-point lead and Pat Lam's side saw out the final few minutes to complete a thrilling win at Kingsholm.
Relegation ruled out but Bears win it late
Coming into this fixture, Gloucester were buoyed by Friday's announcement that the RFU council is to scrap relegation from the Premiership this season. The Cherry and Whites were sitting bottom of the table having lost their past six league games since beating Wasps at Kingsholm in late November.
George Skivington's side got off to the worst possible start after Byrne went over following a devastating Bristol maul.
They hit back as Argentina international Carreras capitalised on poor passes from Piers O'Conor and Siale Piutau, twice finishing from over 50 metres out.
However, Bears flanker Heenan levelled the scores at the break, bursting through to go under the posts.
Bristol had won the previous five meetings between these sides yet Gloucester again restored their lead with Thorley finishing for his first try of the season straight after the restart.
A close-range Lloyd penalty for the Bears made it 17-15 with 20 minutes remaining.
But with Gloucester looking set for just their second win of the season, lock Alex Craig was penalised for a high tackle on Bristol prop Jake Armstrong in the 75th minute.
And Lloyd converted a second kick from 40 metres, rounding off an end-to-end encounter and extending the visitors' lead over Exeter at the top of the table.
Reaction - 'They have a knack for winning gritty games'
Gloucester head coach George Skivington told BBC Radio Gloucestershire:
"I'm disappointed with the outcome, especially with the way the game finished at the end.
"But Bristol are a quality team and they are top of the league for a reason. They have a knack of winning in gritty games.
"I'm very proud of the boys tonight, they threw everything into it, we're a really close group who work hard for each other and I think that came through today.
"Sticking in there for the full 80 minutes is the next step for us."
On relegation being suspended this season: "We stick to the plan; it doesn't matter to us either way. It changes nothing."
Bristol director of rugby Pat Lam told BBC Radio Bristol:
"We got the win, that's the most important thing.
"We've got to give credit to Gloucester but we made it difficult for ourselves. Two intercepts almost cost us the game.
"We lacked a lot of composure and a lot of control. [There was] a lot of uncharacteristic mistakes that caused us a lot of issues. We almost paid the price for it.
"Let's learn [from it]. We got the win and we move on."
Line-ups
Gloucester: Woodward; Carreras, Trinder, Atkinson, Thorley; Twelvetrees, Heinz; Rapava-Ruskin, Walker, Balmain, Garvey, Alemanno, Gibson, Ludlow (capt), Clarke.
Replacements: Socino, Seville, Ford-Robinson, Craig, Morgan, Chapman, Kveseladze, Moyle.
Bristol: C Piutau; Morahan, O'Conor, S Piutau, Purdy; Lloyd, Uren; Chaparro, Byrne, Afoa (capt), Attwood, Vui, Heenan, Thomas, Hughes.
Replacements: Capon, Woolmore, Armstrong, Holmes, Harding, Kessell, Bedlow, Leiua.
Referee: Tom Foley.