Glasgow will return from the south of France with their heads held high after an agonising defeat saw them slump to a fourth straight defeat in Pool Four of the Heineken Cup.
- Related Content
The visitors forged an 8-3 lead at the break thanks to a John Barclay try but Castres fought back, and a Ruaridh Jackson penalty to win the match bounced back off the post as the French side held on.
In a close match at the Pierre-Antoine Stadium, it was Gregor Townsend's Warriors who burst into life quickest and registered a first score with less than two minutes on the clock, Peter Horne making no mistake with a penalty in front of the posts.
Talismanic Romain Teulet, who holds the world record for the most points scored for one club, levelled just three minutes later when the hosts worked the ball to the touchline and Glasgow were penalised for coming in from the side.
The visitors were a much changed side from their 9-6 defeat at Scotstoun Stadium nine days ago, with no fewer than nine new faces and they were clear with their attacking intent.
A pacy display from Niko Matawalu saw Warriors carve upon a usually sound defence, and Horne had an opportunity to restore the lead just 10 minutes in but his kick went wide of the posts.
The normally prolific Teulet was next to miss a penalty when his attempt from the halfway line fell short.
A breakdown in the Castres pack allowed Glasgow to forge their next chance in the 21st minute when Tim Swinson ran on to a Sean Maitland pass but his slow release to Sean Lamont, just two metres from the line, was intercepted by Marcel Garvey.
But as the clock ran down for the half Barclay went over in the corner and Glasgow took a deserved lead into the break.
Castres flew out of the traps at the beginning of the second half as they sought to maintain their unbeaten home record this season.
They could have been level when Garvey dashed 30 metres into Glasgow territory but a knock-on close to the line allowed the visitors a reprieve.
A series of high tackles saw first Tom Ryder sin-binned in the 65th minute and just four minutes later Byron McGuigan was sent to join him for a second high tackle and their indiscipline was to cost them.
Castres made their two-man advantage count just moments later when they drove for the line and Yannick Caballero grounded the ball to pull the match level once more.
Dan Kirkpatrick remained calm as he stood over the conversion and the French side took the lead for the first time with just five minutes left on the clock.
Jackson had the chance to win the match for Warriors after the hosts collapsed a scrum but his kicked bounced back off the post and Castres collected the narrowest of victories as they closed on Pool Four leaders Ulster, who themselves suffered a surprise defeat against Northampton on Saturday.