Bath ended a run of three defeats in the Aviva Premiership with a nail-biting 32-30 victory over Northampton thanks to Rhys Priestland's penalty at the death.
The lead changed hands four times in the last 15 minutes as the Saints came back from 22-9 down to lead 30-29 with three minutes to go but could not hang on.
Bath captured a bonus point with tries by number eight Paul Grant, Semesa Rokoduguni on his 100th appearance, a penalty try and a second-half touchdown by Chris Cook. Northampton had three tries from Ben Foden, Api Ratuniyarawa and Jamie Gibson. Stephen Myler kicked 15 points.
Referee Wayne Barnes penalised the home team at the first two scrums but they profited from an overthrown line-out by Mikey Haywood. Tom Dunn and Max Lahiff carried strongly before Grant brushed past three tacklers to score, although Priestland was wide with the conversion.
When Francois Louw was penalised for going off his feet, Myler pulled back three points from in front of the posts on 17 minutes.
Kieran Brookes continued to do maximum damage to the Bath scrum as the penalties mounted against the home side but a promising position was lost when he too infringed. When Lahiff fell the wrong side of a tackle, Myler kicked Northampton into a 6-5 lead on 25 minutes.
The advantage lasted barely 90 seconds as Bath profited from quick possession and Rokoduguni picked a perfect line from Kahn Fotuali'I's pass to score under the posts, Priestland converting for 12-6.
That sparked an all-out assault on the visitors' line as Priestland was tackled short and Tom Homer was then held up in the corner by Ahsee Tuala's last-ditch tackle. It was only a short respite however as Bath's resurgent scrum forced a penalty try converted by Priestland.
Myler's boot kept Northampton in touch at 19-9 with a third penalty on the stroke of half-time but Priestland cancelled it out with his first penalty soon after the break.
As Bath searched for the bonus-point try, their passing became sloppy and Northampton put together their most convincing spell since the first half. Foden squeezed in at the corner and Myler's conversion cut Bath's lead to six points on the hour.
Confidence drained out of the home team and Northampton forced a string of penalties before replacement prop Kane Palma-Newport was sent to the bin. England squad lock Charlie Ewels stole the line-out and Bath cleared their lines but it was brief respite as the visitors rampaged upfield again to create a close-range try for Ratuniyarawa.
Myler's conversion stole a one-point advantage but it lasted barely a minute as Cook chipped ahead down the left wing and won the race to the touchdown and Priestland converted from touch.
The tit-for-tat continued when Gibson forced his way over from a line-out catch and drive on 74 minutes. Myler's dead-eye kicking regained the lead until Priestland's last-gasp effort.