Leinster put one foot in the Heineken Cup quarter-finals after fighting back from 0-14 down to beat Castres 29-22 at Stade Pierre Antoine on Sunday.
Tries from Jimmy Gopperth and Jordi Murphy, as well as three penalties and a Rob Kearney drop-goal in the second half were enough for the Irishmen to fight back from 14-0 down and remain top of Pool One.
Northampton Saints are the sole team able to catch the Irishmen, though they can only be overtaken if they lose by more than seven at home to Ospreys next week.
Trailing at half time, the visitors came out fighting after the break and sneaked past a Castres team who now have no chance of progressing.
The game burst into life in the ninth minute with the first try. Remi Lamerat took on poor Leinster defence, and after finally being tackled the ball came to Seremaia Bai whose looping pass found Richie Gray in the corner.
Castres were on top, looking to set the pace with quick offloads which saw the home crowd in good voice. That noise spurred the French champions on for their second try. The visitors struggled to deal with the speed of their hosts, with Remi Grosso's inside pass giving Brice Dulin an easy run in.
Leinster had to use power, rather than pace, to hit back soon after. A solid five metre scrum gave Jimmy Gopperth the chance to step away from two opponents and put the Irishman back in the game. Cedric Garcia's long distance penalty looked to have sent Castres into the break ten points ahead, only for Gopperth to score his second moments later. Leinster now went in five points behind.
Leinster failed to capitalise on their strong end to the first period though, and spent large parts of the second half on the back foot, Daniel Kirkpatrick going close as Serge Milhas' men looked to keep their Heineken Cup hopes alive.
After soaking up the pressure, a Gopperth penalty and a superb Rob Kearney drop-goal gave their side a one point lead, with the game turning into a frantic, end to end affair.
Another couple of penalties put the away side all but out of sight, and means Leinster will be in the driving seat going into next week's game. Murphy's try was the icing on the cake, with the only disappointment that his side weren't able to find the bonus point. Lamerat had the final say, though his powerful surge over the line was all in the vain.
Tries: Gray, Dulin, Lamerat
Con: Garcia 2
Tries: Gopperth 2, Murphy
Pen: Gopperth 3
Drop: R Kearney
Castres: 15 Brice Dulin, 14 Remi Grosso, 13 Seremaia Bai, 12 Remi Lamerat, 11 Max Evans, 10 Remi Tales (capt), 9 Cedric Garcia, 8 Piula Faasalele, 7 Ibrahim Diarra, 6 Mathieu Babillot, 5 Christophe Samson, 4 Richie Gray, 3 Karena Wihongi, 2 Marc-Antoine Rallier, 1 Yannick Forestier.
Replacements: 16 Brice Mach, 17 Mihaita Lazar, 18 Benjamin Desroche, 19 Yannick Caballero, 20 Julien Tomas, 21 Daniel Kirkpatrick, 22 Marcel Garvey, 23 Anton Peikrishvili.
Leinster: 15 Rob Kearney, 14 Dave Kearney, 13 Brian O'Driscoll, 12 Gordon D'Arcy, 11 Luke Fitzgerald, 10 Jimmy Gopperth, 9 Eoin Reddan, 8 Jamie Heaslip (c), 7 Jordi Murphy, 6 Kevin McLaughlin, 5 Mike McCarthy, 4 Devin Toner, 3 Mike Ross, 2 Sean Cronin, 1 Jack McGrath.
Replacements: 16 Aardon Dundon, 17 Jack O'Connell, 18 Martin Moore, 19 Leo Cullen, 20 Shane Jennings, 21 Isaac Boss, 22 Ian Madigan, 23 Zane Kirchner.
Referee: Nigel Owens