Cardiff warmed up for the start of the new league season with a hard fought Arms Park victory over their visitors from the west country.
They outscored the English Premiership club by five tries to two, with summer signings Iwan Stephens and Dan Thomas both crossing in the first half.
Bath led 15-12 at the break thanks to a brace of tries from skipper Ewan Richards, but the hosts responded with three lineout drive scores to secure the spoils.
Matt Sherratt’s team will now turn their attention to preparing for their opening URC fixture against Zebre at the Arms Park on Friday, September 20.
This pre-season friendly clash with Bath saw debuts for Welsh international half-backs Aled Davies and Callum Sheedy, who have come on board from Saracens and Bristol respectively, while Ireland prop Ed Byrne made his first appearance following his arrival from Leinster.
For other new recruits like lock Josh McNally, flanker Thomas, wing Stephens and South African scrum-half Johan Mulder, it was a first home outing at the Arms Park.
It didn’t take long for Stephens - the son of former Wales fly-half Colin - to open his account as the signing from Newcastle squeezed over in the corner after receiving a long pass from Cam Winnett.
Fly-half Tinus de Beer was wide with his conversion attempt and then picked up a yellow card five minutes later for a deliberate knock on.
Bath swiftly capitalised on their extra man as second row Richards forced his way over from close range and he repeated the trick after De Beer’s return following a series of forward carries.
Richards’ eventful half culminated in him being sin binned just before the break for a lineout maul offence and that was the cue for Cardiff to strike.
Their powerful scrum earned them a further penalty and former Bristol openside Thomas took a quick tap to surge for the line, spinning his way over in the fifth minute of stoppage time, with De Beer converting to reduce Bath’s interval lead to three points.
The second half began with the hosts still having a numerical advantage and they soon made the most of it to take the lead, with a rapid lineout drive enabling hooker Liam Belcher to celebrate being named captain for the coming season.
Bath briefly went back in front as fly-half Ciaran Donoghue landed his third successful shot at goal before Cardiff claimed another lineout maul score as the backs joined the drive and No 8 Mackenzie Martin touched down.
That enabled Sheedy to rack up his first points for the club as the fly-half slotted the conversion a couple of minutes after coming on for his debut as a replacement for De Beer.
The hosts made the victory safe late on as they completed a hat-trick of lineout drive tries with replacement hooker Daf Hughes doing the business.
In the closing minutes of the game, you had the rare occurrence of two brothers figuring on opposing teams, with Cardiff’s new teenage centre Steff Emanuel and Bath prop Ioan Emanuel having both come off the bench.