Zach Mercer's late try and a nerveless conversion from James Wilson clinched a 33-32 home victory for Bath against Sale in the Aviva Premiership.
The hosts had trailed for much of the topsy-turvy contest and were six points down in the final minutes before blindside flanker Mercer struck for his brace.
After more than 20 phases of attack and quick hands from Ben Tapuai, Mercer dummied over in the 78th minute to make it 32-31 to the visitors.
Versatile Kiwi Wilson was starting his first match at fly-half for Bath due to injuries and his crucial conversion was by no means simple, but he held his nerve to slot his seventh goal of the game.
The hosts had started with real intent when Elliott Stooke gathered to pave the way for an early three points, though Bath proved porous in defence.
When Will Addison stepped his way past Matt Garvey there was no stemming the tide of yellow attacks which followed.
Denny Solomona popped up and had too much speed and agility for Josh Bayliss and Henry Thomas as he scored the opening try of the game in the 14th minute.
Sharks' second was slick but simple. Attacking off a lineout, Ben Curry found Faf de Klerk, who got on the outside of Wilson to create an overlap, with quick hands sending Marland Yarde through.
Penalties were exchanged before Mercer gave the home fans something to cheer. Lurking on the left shoulder of Taulupe Faletau - making his first appearance since suffering knee ligament damage in December - he latched onto a cute pass and cantered under the posts.
Wilson's conversion gave Bath a one-point lead, which was chalked off when De Klerk slotted penalties either side of half-time.
The hosts began to get their act together and their isolated runners charged in pairs. After Will Hurrell and Ross Batty went close, Josh Bayliss made no mistake as he stepped inside Sam James following a tip on from Wilson.
Tit-for-tat penalties meant it was still a one-score game going into the final quarter, with Sharks 27-26 up.
When Sharks had a scrum on their 22-metre line, not much looked on, but De Klerk went blind at pace before sending Solomona away down the right touchline.
He did not break stride as he took the pass, outpaced Aled Brew, chipped over and gathered to score.
It meant Bath needed to strike late for victory and, having twice lost by a point at home this season, this time they were the winning side.