|Bath: (10) 44|
|Tries: Faletau 3, Brew, Clark, Fruean Cons: Priestland 4 Pens: Priestland 2|
|Gloucester (8) 20|
|Tries: May 2, Halaifonua Con: Hook Pen: Hook|
A hat-trick from Wales' Taulupe Faletau helped Bath take the battle for the fourth Premiership play-off spot down to the final day with a bonus-point win that ended Gloucester's top-six hopes.
Faletau and Gloucester's Jonny May traded tries before Bath took full control of the local derby at the Rec.
Aled Brew powered over, Max Clark raced in and Robbie Fruean got Bath's fourth.
Faletau got his second and third tries either side of May's second, before David Halaifonua's consolation score.
Other than crossing for their two late tries in a frenetic finish, Gloucester had faded badly for a 30-minute spell after half-time in which Bath were rampant and clinical.
The hosts remain fifth but are now four points below fourth-placed Leicester, with one round of matches remaining.
Tigers will travel to Worcester on 6 May while Bath are away at Sale Sharks where, barring a huge swing in points, they will need a bonus-point victory and for Leicester to come away from Sixways with nothing in order to claim the final play-off place.
After a scoreless first 20 minutes at the Rec, Wales' Rhys Priestland and James Hook exchanged penalties before Faletau skilfully collected Kahn Fotuali'i's chip for the afternoon's first try.
May caught Billy Burns' perfect kick to the corner to bring Gloucester back into an even, low-key first period, before the hosts dominated after the break.
Brew converted after a patient move for Bath's second, before Clark danced clear for a classy third and Fruean quickly extended the advantage.
British and Irish Lions back row Faletau capped a fine individual performance with two further tries of his own, while May and Halaifonua's late scores could not stop Challenge Cup finalists Gloucester from seeing their hopes of earning automatic Champions Cup qualification end.
However, the Cherry and Whites can still make it into the Champions Cup via a play-off if they either win the Challenge Cup or finish seventh in the Premiership.
Victory for Bath though did guarantee themselves at least a top-six spot this term, and a return to Europe's premier club competition next season.
Bath's Taulupe Faletau told BBC Radio Bristol:
"Over the last couple of weeks we were disappointed with our performances. We owed our home fans a decent performance.
"I thought [Max] Clark was outstanding but the Man of the Match award could have gone to any of the 15 out there.
"We have still got to work on the errors that we made today to iron out for next week."
Gloucester director of rugby David Humphreys told BBC Radio Gloucestershire:
"We let ourselves down. We let the supporters down. We know how important this game is to everybody at the club.
"Bath executed very well and all of a sudden we were chasing the game. Our set-piece was under a lot of pressure but when we had the ball we were dangerous.
"Maybe we were a little bit tired but the players were all excited to play. Once you go behind in a game like that, it is hard to get going again, having conceded two tries so quickly."
Bath: Homer; Watson, Clark, Tapuai, Brew; Priestland (co-capt), Fotuali'i; Catt, Brooker, Knight, Charteris, Stooke, Garvey, Louw (co-capt), Faletau.
Replacements: Batty, Obano, Palma-Newport, Attwood, Ellis, Cook, Ford, Fruean.
Gloucester: Hook; May, Trinder, Atkinson, Halaifonua; Burns, Heinz (capt); Hohneck, Hibbard, Afoa; Galarza, Thrush; Moriarty, Rowan, Morgan.
Replacements: Matu'u, McAllister, Knight, Savage, Ludlow, Laidlaw, Twelvetrees, Sharples.
For the latest rugby union news follow @bbcrugbyunion on Twitter.