|Harlequins (21) 35|
|Tries: Sloan, Walker 2, Horwill Cons: Botica 3 Pens: Botica 3|
|Bath (6) 28|
|Tries: Mafi, Williams, Rokoduguni Cons: Homer 2 Pens: Homer 3|
|Friday's Premiership action as it happened|
Harlequins survived a late Bath onslaught to earn a bonus-point win and go fifth in the Premiership.
Bath conceded 24 points either side of half-time while they were down to 14 men after Chris Cook was sin-binned.
Charlie Walker crossed twice and James Horwill also went over for the hosts, adding to Harry Sloan's early score.
But Bath scored three tries and 22 unanswered points in the final 15 minutes to earn an unlikely bonus point of their own.
Amanaki Mafi, Jeff Williams and Semesa Rokoduguni all touched down after Harlequins replacement Sam Twomey was sin-binned, and Tom Homer kicked a penalty in the closing seconds to ensure Mike Ford's side would not leave The Stoop empty-handed.
However, last season's Premiership finalists remain ninth in the table, having won only two of their eight league games in 2016 and five of 15 Premiership outings all season.
Sloan's first Premiership try for more than two years gave Quins a perfect start and Conor O'Shea's side stretched their lead from 11-6 to 35-6 in the 10 minutes after Bath scrum-half Cook was shown a yellow card for a deliberate knock-on.
Walker's brace of tries took his tally for the season to eight, making him the leading scorer in the Premiership this season.
And the home side held out for a league double over Bath, despite the visitors using their extra man to full effect while Twomey and later Horwill were sent from the field for indiscretions.
Harlequins director of rugby Conor O'Shea:
"What a game of rugby, the first half was lung-bursting and we played some brilliant rugby and it's a massive win.
"We were killed by the referee in the second half as we were penalised for the fun of it. It was as if the referee felt that the game shouldn't have been all one way.
"This eight-game challenge has been very tough for us with five out of the seven games on the road with a young and small group."
Bath head coach Mike Ford:
"The sin-bin cost us as they scored 24 points in Cook's absence. They scored just before half-time so we had to change the half-time team talk and then we conceded another soft one so our heads went down.
"We should have had a penalty try at a crucial stage in the first half when Horacio Agulla was hauled down near the line. Their player tackled Amanaki Mafi when he was in an offside position.
"We showed great character to get a bonus point from that position and that was very positive. We'll take heart from the last 30 minutes but we did give them three of their four tries."
Harlequins: R. Chisholm; Walker, Lowe, Sloan, Cheeseman; Botica, Dickson; Lambert, Ward, Sinckler, Merrick, Horwill (capt), Luamanu, Wallace, Easter.
Replacements: Gray, Evans, Collier, Twomey, J. Chisholm, Tebaldi, Marchant, Lindsay-Hague.
Sin-bin: Twomey (65), Horwill (77).
Bath: Homer; Rokoduguni, Banahan, Eastmond, Agulla; Devoto, Cook; Lahiff, Webber, Thomas, Ewels, Day, Garvey, Louw (capt), Mafi.
Replacements: Frost, Catt, Wilson, Houston, Mercer, Evans, Clark, Williams.
Sin-bin: Cook (35).
Referee: Dean Richards.
For the latest rugby union news follow @bbcrugbyunion on Twitter.