Castres left it very late to win a dramatic dead rubber match against Gloucester 24-22 and finish second in Pool Two.

The hosts had made 13 changes to the side that was outplayed at Exeter six days previously, while Gloucester’s squad showed 10 changes from the Kingsholm defeat against Munster.

In an opening half of two quarters at Stade Pierre Fabre, the visitors were quickest to find their feet. Henry Trinder finished off some smart interplay to score in the corner after less than 90 seconds.

Castres were still to get on the board when Gloucester scored their second through scrum-half Ben Vellacott as the clock ticked past 20 minutes.

By then the hosts had wasted two penalty chances, opting for touch rather than points and coming away with nothing. Then a gilt-edged opportunity in open play went begging, as Gloucester demonstrated defensive nouse to match their early attacking ambition.

Castres started out trying to play expansive rugby, but – unlike Gloucester – it wouldn’t come naturally.

So, they reverted to forward-power force. Although they started to choke territory and possession – Gloucester barely made it into opposition territory in the second quarter – it looked like it wasn’t working.

Their experienced front row had the nudge on Gloucester’s all-academy counterparts. But, Castres looked set to finish the opening period scoreless, until centre Florian Vialelle finally burst through a stretched defence following another penalty to touch after the hooter.

The second half started as the first had finished, with Castres camped on Gloucester’s line. First, they were held up; then they knocked on; then they conceded a free kick.

Martin Laveau was tackled into touch five metres out – and Castres conceded another penalty. But they won the lineout and attacked again through Laveau. This time, the hosts kept the ball alive long enough for Vialelle to score his second.

Castres head coach Christophe Urios then changed his front row. The new trio’s first act as a unit was to give away a penalty bang in front that Owen Williams duly slotted to push Gloucester back into the lead.

Castres wasted numerous chances. Their profligacy looked like it had cost them dearly with 12 minutes left on the clock when Williams latched on to a perfect inside ball from Matt Banahan to score the visitors’ third.

Three minutes later, man-of-the-match Vialelle turned provider to supply the final pass on a sweeping move for Armand Batlle to score in the corner.

It seemed all over when the hosts wasted another five metre lineout chance. Gloucester could have ended it with that after-the hooter steal – but a wayward clearance kick gave Castres one final chance from 70 metres out.

One last penalty kick to touch gave them a lineout five metres from Gloucester’s line. And Ma’ama Vaipulu stormed over from short-range to give Castres their first try-scoring bonus of the tournament.