Stephen Donald won the duel of the All Black fly-halves to earn Bath a stirring 21-18 victory and inflict a third Aviva Premiership defeat on league leaders Harlequins.
Donald turned in his best performance for Bath by kicking seven penalties from eight attempts but it was nip and tuck all the way through against fellow New Zealander Nick Evans, whose boot was also responsible for all his side's points.
Bath's never-say-die spirit was typified by former Scotland number eight Simon Taylor who led a monumental effort in the loose to blunt Harlequins dynamic attack.
On his return from injury Evans wasted no time in pinning Bath back into the corner and the pressure brought a succession of penalties, eventually allowing the New Zealander to open the scoring. Nick Abendanon's counter-attacking verve earned Donald a chance at the other end but the World Cup winner was off target.
Bath continued to wage a fierce battle on the gain-line and were rewarded on 16 minutes when Donald chipped over a penalty in front of the Quins posts to level at 3-3. Back came Quins, Evans pulling the strings to fashion an opening for Nick Easter but Jordan Turner-Hall was bottled up when he threatened to burst free.
Bath infringed and Evans knocked over a 23rd minute penalty. But it was the home side who finished the half strongest as Donald punished a ruck infringement with a kick from 35 metres and was then successful with a 50-metre effort to send his side in at half-time with a 9-6 lead.
Quins began the second half hesitantly and Dickson sliced a box kick into touch. Mark Lambert earned a warning for taking out Simon Taylor in the line-out and Donald kicked his fourth penalty. After Evans missed a straightforward chance to pull back three points Quins earned a penalty and scrum-half Karl Dickson sped away only to be caught on the line by Guy Mercer. The visitors fancied their chances at a series of reset scrums but Bath held their nerve and Evans eventually had to be content with a 56th minute penalty.
A late challenge by Mercer on Evans, duly punished by the Kiwi, brought the Londoners level on the hour but Bath were back in the lead four minutes later as Donald was on target with his fifth penalty. Back came Evans from 45 metres and it was 15-15.
Harlequins failed to deal with the restart, however, and Bath surged to the line. Three times they tried to ground the ball and Banahan appeared to be closest to scoring only for the TV match official to deny him. It was at least a penalty advantage and Donald was on target again.
As the match entered the final stages Donald kept his cool, lining up another kick at the other end to put Bath 21-15 ahead only for Evans to land his sixth penalty with four minutes left. Harlequins threatened again but a crucial turnover by Guy Mercer won back possession and four vital points.