Northampton ended their Heineken Cup pool with a 13-3 victory over French champions Castres but it took them until the final minute to break down a ferocious visiting defence.
George Pisi scored the only try of a clash where Northampton's power game suffered an outage against Castres' muscle-bound blue line.
The win could still to see Northampton reach the quarter-finals as one of the two best runners-up if results go their way, but the Amlin Cup seems more likely.
Castres came to Franklin's Gardens with no chance of reaching the quarter-finals but made just one change to the starting 15 that lost to Leinster, with Daniel Kirkpatrick coming in for Remi Tales at fly-half.
Northampton brought Lee Dickson in at scrum-half with Samoan Fa'atoina Autagavaia making his first start for the club at full-back in place of the injured Tom Collins.
The home side looked for four tries from the start as they knew only five points and pointless defeat for Leinster would see them top pool one. They turned down easy penalty chances in the opening minutes, but a series of scrums did not produce a try.
Northampton were dominant at the scrum and after 27 minutes Castres tighthead Anton Peikrishvili was replaced by Mihaita Lazar and it was not clear that he was injured.
Despite that Castres were hard in the tackle and showed they meant business with even Courtney Lawes bent double by one hit from Piula Faasalele, plus they were disrupting Northampton's usually efficient lineout.
Castres thought they had taken the lead on 33 minutes when a quick lineout on halfway saw Remi Grosso scoot under the post, but referee Alain Rolland went to the TMO who spotted they had used a different ball.
Saints could not get into their attacking game, caught in the web-like Castres defence and in a half of just two penalties on the floor the second one saw Stephen Myler make it 3-0 on the half-time whistle.
Marcel Garvey almost got Castres on the scoreboard, with a superb 30-metre break, but the former Worcester flyer slipped as he looked to step round full-back Autagavaia and as the attack fizzled out Kirkpatrick put a drop goal attempt well wide. But when they won a penalty on 54 minutes, almost 50 metres out, Rory Kockott levelled the scores.
When Northampton needed a big shove from their scrum it deserted them five metres from the Castres try line, while Christian Day and Tom Wood made breaks on the left flank but twice the pass to George North went astray. And despite all their pressure it looked like they would fall behind when Kockott fired a 50m-plus penalty on target but his kick fell just short.
But with four minutes to go smart play from Kahn Fotuali'i saw the replacement scrum half throw a pass into Lazar's head and from the offside Myler slotted an easy penalty to make it 6-3.
And when Kockott was charged down by Pisi in his 22 the Samoan centre gleefully dived onto the bouncing ball to score the first try of the game in the final minute, which Glenn Dickson converted.
Northampton skipper Dylan Hartley praised his side's character as they dug out an ugly win against French champions Castres.
Leinster's thrashing of Ospreys meant the 13-3 win was to no avail in terms of Heineken Cup qualification, not that it took anything away from the quality of Northampton's performance.
George Pisi scored the only try of the game in the final minute, though Northampton needed a bonus point win to have any chance of topping pool one meaning it mattered little.
Saints are now hoping for an unlikely set of results to finish as one of the two best runners-up to reach the quarter-finals or it will be the third season in a row that they have missed out on the knockout stages of the Heineken Cup.
Hartley said: "Before the game I said 'let's not worry about the maths, let's just win tonight and see where we are at. Whatever competition we will be in we will give it a good crack'.
"We showed plenty of character to play to 80 minutes against the French champions and take that opportunity right at the end. As frustrating as it was to watch, playing it was equally frustrating.
"With nothing to play for you might have expected them to fold, but they didn't. We probably should have got the scoreboard ticking over early on, but I decided to go for the pushover try and it didn't come off. If we had gone 3-0, then 6-0, 9-0, 12-0 they might have shut up shop.
"But if you have a feel for it on the field you have to go for it, the scrum was dominant so you have to go for it."
Northampton director of rugby Jim Mallinder was impressed by Castres' defence and feels ultimately it was the defeat in France that cost his side finishing top of pool one.
"They are the French champions and they proved it tonight," said Mallinder.
"Their defence was very good, their line speed cut down our options, stopped us getting on the front foot and getting any momentum.
"You asked what we have learned from the Heineken Cup this year, and first of all you could really do with an Italian side in your pool rather than three quality sides.
"We will also look at the game down at Castres and think that was a big opportunity we missed. We gave them an interception try early on. We came back into the game and very nearly won the game. But when you are up against good sides like that you have really got to take your opportunities."