Paris - Two-time defending champions Leinster defeated Exeter 29-20 on Saturday to stay alive in the European Cup, but they face a nailbiting Sunday which could doom their hopes of a fourth title in five years.
The Irish side finished second in Pool 5 behind runaway leaders Clermont and can only make the quarter-finals by claiming the remaining best runners-up spot after Montpellier booked their last-eight place earlier in the day.
Leinster had trailed Exeter 17-12 at the interval after converted tries from Neil Clark and a penalty try helped edge the visitors' scores from Gordon D'Arcy and Rob Kearney.
Brian O'Driscoll then brought Leinster level before Jamie Heaslip's try earned a bonus point victory.
Leinster finished their group campaign with 20 points, but Irish rivals Munster can deny them a quarter-final spot if they score four tries and beat Racing Metro on Sunday in Pool 1 where Saracens are also expected to qualify by beating Edinburgh.
Clermont had already made sure of their quarter-final place and Saturday's 29-0 win over the Scarlets gave them 28 points from six wins and a home clash in the next round against Montpellier.
Montpellier defeated Toulon 23-3 in an emotionally-draining clash to reach the quarter-finals for the first time.
Montpellier, playing just days after the death of forwards coach Eric Bechu, finished their Pool 6 campaign on 22 points, enough to take one of the two best runners-up spots.
Despite the defeat, Toulon had already made the last eight as pool winners.
Montpellier thrived in the driving rain, scoring tries through Thomas Combezou and Benoit Paillaugue while Toulon, who finished on 23 points, missed out on a bonus point that could have guaranteed a home quarter-final.
In the day's other Pool 6 game, Cardiff Blues saw off Sale 26-14.
Last season's beaten finalists Ulster rounded off their pool campaign with a first win in France at their 15th attempt, beating Castres 9-8.
All their points came from the boot of South African Ruan Pienaar, but a weakened side were unable to get the bonus point that would have strengthened their chances of getting a home quarter-final.
The 1999 European Cup winners, who topped Pool Four with 23 points, will have to wait till the end of the weekend to see if they entertain their quarter-final opponents in Belfast.
"We wanted to win and even by a point, I'll take it. A win is a win," said Ulster coach Mark Anscombe.
"It wasn't our best performance but we knew it would be difficult here. I don't know if we will be playing at home in the quarter-finals, but the most important thing is that we are in the last eight. We will play anyone, anywhere."
Castres went into the final 20 minutes with an 8-6 lead, Remy Lamerat's try and South African kicker Rory Kockott's penalty giving them the edge.
Ulster had two Pienaar penalties to their credit.
Pienaar, who had been moved to fly-half from scrum-half for the match, sent Ulster into the lead for the first time with a penalty in the 64th minute.
In the pool's other match a surprisingly effective performance by previously winless Glasgow saw the Scottish side beat English giants Northampton 27-20 which ended any hopes the 2000 champions had of making the last eight as a one of the two best runners-up.
Heineken Cup results and fixtures:
Castres (FRA) 8 Ulster (IRL) 9
Glasgow (SCO) 27 Northampton (ENG) 20
Exeter (ENG) 20 Leinster (IRL) 29
Scarlets (WAL) 0 Clermont (FRA) 29
Cardiff Blues (WAL) 26 Sale (ENG) 14
Montpellier (FRA) 23 Toulon (FRA) 3
Munster (IRL) v Racing Metro (FRA) (1245)
Saracens (ENG) v Edinburgh (SCO) (1245)
Leicester (ENG) v Toulouse (FRA) (1500)
Treviso (ITA) v Ospreys (WAL) (1500)
Biarritz (FRA) 9 Harlequins (ENG) 16
Connacht (IRL) 25 Zebre (ITA) 20