Northampton Saints ensured European Champions Cup rugby next season with a hard-earned victory over Wasps.
After Harlequins' win over Bath earlier on Saturday ended their slim play-off chances, Saints led 14-7 with an early Sam Matavesi score and a penalty try.
But tries from Dan Robson, brilliantly created by Thomas Young, and Brad Shields helped bring Wasps level.
Dan Biggar kicked Saints 23-17 ahead before Tom Wood's fortuitous try, with Tom Willis earning Wasps a bonus point.
The number eight's injury-time score lifted his side above Bath into eighth place on points difference, with two games of the regular season left.
The top eight in the Premiership will earn qualification for the elite European competition next season.
Saints, with an 11-point cushion over Wasps and Bath, have at least guaranteed they will be involved despite missing out on the top four.
If there was any sense of deflation in the hosts' ranks, it was not evident as they came out the blocks hard.
Hooker Matavesi exploited some poor line-out defence from Wasps to trundle over with barely two minutes on the clock, but the visitors' response was of the highest order.
Young's brilliant step and break took him into the Saints 22 before the Welsh flanker's perfectly-timed offload sent the supporting Robson scampering over.
Courtney Lawes, in his first club outing since December after a pectoral injury sustained playing for England during the Six Nations, was certainly keen to make an impression and could be pleased with his 66-minute contribution.
Selected in the British & Irish Lions squad to tour South Africa despite his enforced absence, the 32-year-old used his elongated frame to win a couple of early turnovers and his offload on the right flank set Saints on their way to a 14-7 lead.
Tom James' kick ahead was knocked on by Wasps full-back Charlie Atkinson and Jacob Umaga, coming from an offside position, instinctively picked up the loose ball. With two Saints players in position to score, referee Adam Leal awarded a penalty try.
Umaga was also sin-binned for his troubles, but the visitors responded well to going a man down, captain Shields driving over from a line-out move and Atkinson's conversion levelling the scores.
A penalty apiece from Biggar and Umaga made it 17-17 at the interval before the Wales fly-half nudged the hosts ahead again as Saints co-captain Alex Waller - in his 300th game for the club - earned two scrum penalties in quick succession.
Wasps created further try-scoring chances - Paolo Odogwu's forward pass saw Zack Kibirige's score ruled out and a probing kick through from Robson just eluded Kibirige's grasp, while Will Rowlands opted for contact with a three-man overlap beckoning.
A brilliant 80m break and finish from Saints wing Ollie Sleightholme was also disallowed after a slight knock-on in the act of picking the ball up in his own 22.
But there was a touch of good fortune about the decisive try with 10 minutes left, with Northampton lock David Ribbans appearing to nudge the ball forward out of Rowlands' hands as Wasps lost possession at a line-out on their own line.
But after consultation with the television match official, Wood's try was awarded and the visitors had to settle for a potentially vital losing bonus point.
Northampton: Freeman; Sleightholme, Proctor, Dingwall, Naiyaravoro; Biggar, James; Waller (co-capt), Matavesi, Hill, Ribbans, Ratuniyarawa, Lawes, Ludlam (co-capt), Wood
Replacements: Haywood, Iyogun, Painter, Moon, Coles, Tupai, Francis, Grayson
Wasps: Atkinson; Kibirige, Odogwu, Le Bourgeois, Bassett; Umaga, Robson; West, Oghre, Alo, Rowlands, Gaskell, Shields (capt), Young, Willis
Replacements: Cruse, McIntyre, Toomaga-Allen, Cardall, Vailanu, Vellacott, Gopperth, Miller
Referee: Adam Leal