Anthony Watson scored a try in dead time to give Bath a 25-23 victory over Wasps in the European Rugby Champions Cup.
The two sides swapped penalties early on as Ruaridh Jackson put the hosts in front with his kick but George Ford replied for Bath six minutes later to level the scores.
Two minutes later, Jonathan Joseph scored a try after picking up the loose ball, selling Charles Piutau a dummy before racing over the line to give Bath their first lead of the day.
Eliot Day closed the gap to four points with a long-range penalty, with the kicker nailing an effort from the halfway line.
Bath went further in front as Matt Banahan and Niko Matawalu played a one-two, with the former sprinting home unopposed for the away side's second try, but Ford missed the following conversion.
Day missed another long penalty but Jackson hit two late three-point kicks to reduce the scores to 15-12 at the break.
Ford hit another penalty in the second half that was quickly replied to by Jackson, who then missed a kick that would have pulled his side level.
Rob Miller then saved his teammates' blushes as he bundled over the line to give Wasps their lead back but Jackson's kicking woes continued as he failed to hit the conversion.
Substitute fly-half Jimmy Gopperth thought he had sealed the deal for Wasps with six minutes remaining, dissecting the posts from a penalty to stretch Wasps' lead to five points.
It took until the 84th minute for Watson to cross the line, and Ford converted from the touchline to give Bath a dramatic victory.