Castres needed a 73rd-minute try from their pack to snatch a drama-filled 10-8 Heineken Cup victory over Glasgow on Saturday.
The result moves Castres into second place in Pool 4, three points behind Ulster and two ahead of Northampton.
A stop-start first half highlighted by missed kicks from both sides was drawing to a close with the scores locked at 3-all until Glasow flank John Barclay scored the first try to give the visitors an 8-3 lead at the break.
But Castres flank Yannick Caballero scored at the back of a rolling maul in the dying minutes, against 13 men, to put the hosts ahead.
And the drama continued as Glasgow fly-half Ruaridh Jackson hit the upright with last-gasp penalty, leaving the Scottish side winless in four games.
Warriors coach Gregor Townsend made nine changes to the side which lost at home last weekend, and his changes showed straight away. Glasgow matched Castres' physicality, while speed among their backs caused problems for the French side throughout.
Peter Horne slotted the first points in the first minute, kicking a simple penalty from in front of the posts, before Romain Teulet equalised minutes later.
Glasgow's speed in their running caused problems for Castres, and they were unfortunate not to score on 20 minutes, when Marcel Garvey intercepted a pass out to Canadian international DTH van der Merwe on the wing.
But the first try of the game arrived moments before half-time, as Barclay charged to the line, evading the attention of Garvey, but was injured in doing so, and that was his last involvement in the game.
Castres came out for the second half full of intent, and put Glasgow under severe pressure, forcing them into conceding penalties in their 22.
But once Glasgow were able to get on the ball, their speed gave Castres further problems. Fijian international scrum-half Nikola Matawalu made a break towards the line from his own half, and was only undone with a dropped ball in the tackle only five metres from the whitewash.
Tom Ryder saw a yellow card with 15 minutes to play, playing his opponent in the air at a line-out. Castres then had Glasgow under the cosh, forcing several penalties at the scrum, but a loss of control allowed Glasgow to clear their lines.
Glasgow then went down to 13 men, as Byron McGuigan tackled Brice Dulin after he had kicked upfield, and was yellow carded with nine minutes to play.
The inevitable came only a minute later, as Caballero powered over with the help of a driving maul, before Daniel Kirkpatrick gave his side the lead with the simple conversion.
Jackson had the chance to give his side the win only two minutes from time, but hit the post with his penalty kick from distance, allowing the passionate home crowd to breathe a huge sigh of relief on the whistle.
Yellow cards: Ryder, McGuigan
Castres: 15 Romain Teulet, 14 Paul Bonnefond, 13 Romain Cabannes, 12 RÃ©mi Lamerat, 11 Marcel Garvey, 10 RÃ©mi Tales, 9 Thierry Lacrampe, 8 Pedrie Wannenburg, 7 Yannick Caballero, 6 Jannie Bornman, 5 Iosefa Tekori, 4 Matthias Rolland, 3 MichaÃ«l Coetzee, 2 Mathieu Bonello, 1 MihaÃ¯ta Lazar.
Replacements: 16 Brice Mach, 17 Karena Wihongi, 18 Saimone Taumoepeau, 19 Christophe Samson, 20 Ibrahim Diarra, 21 Thomas Sanchou, 22 Daniel Kirkpatrick, 23 Brice Dulin.
Glasgow: 15 Sean Maitland, 14 Tommy Seymour, 13 Sean Lamont, 12 Peter Horne, 11 DTH van der Merwe, 10 Ruaridh Jackson, 9 Niko Matawalu, 8 Ryan Wilson, 7 John Barclay, 6 James Eddie, 5 Tom Ryder, 4 Tim Swinson, 3 Moray Low, 2 Pat MacArthur, 1 Gordon Reid.
Replacements: 16 Dougie Hall, 17 Ryan Grant, 18 George Hunter, 19 Nick Campbell, 20 Rob Harley, 21 Sean Kennedy, 22 Graeme Morrison, 23 Byron McGuigan.
Venue: Stade Pierre Antoine
Referee: Andrew Small (England)
Assistant referees: Tim Wigglesworth (England), Roy Maybank (England)
Television match official: David Grashoff (England)