Defender Mark Preece pulled the plug on Bath's FA Cup dream as he nodded home the winner and book Forest Green's place in the third round with a 2-1 win.
Preece ghosted in at the near post to head home the winner three minutes into the second half after Bath's Lewis Hogg had cancelled out Jonathan Smith's opener.
Midfielder Smith had taken just 24 minutes to draw first blood with a deflected effort.
The 23-year-old picked up the ball 30 yards from goal, ghosted past his marker and fired a shot which deflected off Bath skipper Jim Rollo and left keeper Ryan Robinson stranded.
Kaid Mohamad then missed a golden chance to level for Bath on 32 minutes as he ballooned Hogg's left wing cross over the bar.
But Bath levelled a minute before half-time when former Bristol Rover midfield Hogg powerfully headed home Sekani Simpson's inswinging right-wing cross at the back post.
But Rovers were ahead three minutes after the restart as centre back Mark Preece found space at the front post and headed home Conal Platt's corner.
Platt could have extended the lead on 56 minutes but shot side of the post from 15 yards when one-on-one with keeper Robinson.
City top scorer Darren Edwards could have snatched one back on the hour mark, but put his header wide.