Northampton 21-15 Connacht
Connacht will play in the Challenge Cup next season after pushing Northampton all the way in a 21-15 Champions Cup play-off semi-final defeat at Franklin's Gardens.
Saints now face a home clash with Stade Francais next Friday, and the winners will take the last remaining place in next season's competition.
Nic Groom and Harry Mallinder scored tries for the home side with Mallinder converting one and adding three penalties.
David Heffernan and Niyi Adeolokun scored tries for Connacht, with Craig Ronaldson converting one and kicking a penalty.
But there was to be no fairy tale ending for their head coach, Pat Lam, who takes over at Bristol for next season.
Connacht suffered a pre-match setback when lock Andrew Browne withdrew with a calf injury to be replaced by a former Saint in James Cannon.
Within a minute of the start, the Irish were hit with two further blows. First the hosts scored the opening try after Tiernan O'Halloran failed to collect an up-and-under from Groom. The ball ran loose for Luther Burrell to set up the try for Mallinder.
And then the Westerners lost left wing Cian Kelleher to an injury, with Matt Healy coming on in his place.
Mallinder converted from the touchline before Connacht drew level when wing Adeolokun collected a kick-through from Ronaldson to show considerable determination and force his way over.
Ronaldson converted before Mallinder succeeded with a penalty to leave Northampton with a 10-7 lead at the end of the first quarter.
The home side lost Burrell, who limped off to be replaced by Rory Hutchinson, before Mallinder extended their lead with his second penalty.
Ronaldson replied with a penalty for Connacht before careless handling errors from Danie Poolman and O'Halloran gifted Saints a platform in the Irish 22 but the concession of needless penalties prevented the hosts from capitalising.
Northampton held a narrow 13-10 lead at the interval, which was when French referee Mathieu Raynal was forced to withdraw with an injury sustained in a hefty collision with Saints prop Alex Waller.
The opening period of the second half was featureless until a clever piece of play from Groom sent George North away on a 50-metre run, but the flowing movement was halted when Ben Foden put a foot in touch.
However, it was the catalyst for Northampton's best period of the match, with a strong burst from centre Nafi Tuitavake bringing the crowd to its feet.
After 56 minutes, Saints scored the crucial try when Ahsee Tuala powered over the gain line to create the space for Groom to dart over.
The home side brought on Tom Wood for Teimana Harrison in the back row before Heffernan finished off a driving line-out.
But a third penalty from Mallinder was just enough to see Northampton over the winning line, despite a late yellow card for their flanker Jamie Gibson.
Lam said: "I was proud of the effort and am happier to be leaving after this performance as opposed to a couple of very poor performances in recent weeks.
"We fronted up and worked hard off the ball but discipline and little errors cost us as we didn't have enough accuracy and needed to play at a quicker tempo.
"We had opportunities to win the game but didn't take them and that's been the story of our season.
"It wasn't an easy decision to make to leave Connacht after four years but while we are still the weakest province in terms of budget, there have been lots of changes for the better with the support of all four counties in Western Ireland being terrific."
Northampton director of rugby Jim Mallinder was a relieved man.
"We knew they would stick together and be competitive throughout as we've never had an easy game against them," he said.
"Remarkably I didn't have any problems raising the players for this game as they've been fantastic throughout the week.
"It's a terrific way to end the season with a home game against Stade but we'll have to play a lot better if we are going to win as they are getting better week by week.
"I'm not really a fan of these play-offs as it makes it a long season but we've been given a chance so we need to take that opportunity and from a financial point of view it's not the end of the world with two extra home games."