|Harlequins (10) 20|
|Tries: Visser, Sinckler Cons: Catrakilis 2 Pens: Catrakilis, Smith|
|Bath (5) 5|
Harlequins ended a four-match losing run as they put a dent in Bath's Premiership play-off hopes.
Matt Banahan's try put Bath ahead but the hosts led 10-5 at half-time thanks to Tim Visser's try and a conversion and penalty from Demetri Catrakilis.
Replacement Kyle Sinckler's try then gave Harlequins some breathing space.
The visitors were twice denied by the TMO as they made a push in the final 10 minutes, but Quins won for the first time in the Premiership in 2018.
- Relive all of Sunday's Premiership action
- Exeter go seven points clear with win over Saracens
- Wasps into second with win over London Irish
- Leicester secure bonus-point win over Worcester
Defeat for Bath is a blow to their hopes of finishing in the top four and they are five points behind fourth-placed Newcastle.
Ninth-placed Harlequins, who had lost their previous four matches against Sale, Wasps, Leicester and Newcastle, had not lost five in a row since the 2006-07 season and they made a poor start.
The visitors took the lead on a quick break down the short side as Toby Faletau and Kahn Fotuali'i combined to set up Banahan in the corner, who also scored when Bath beat Harlequins 38-14 earlier in the season.
Harlequins were not at their best before the break but they turned the game on its head in the space of six first-half minutes.
Visser intercepted Tom Homer's stray pass to run-in for a try before Catrakilis added the conversion and a subsequent penalty as the home side opened up a five-point half-time lead.
After only being on the field for a minute, Sinckler drove over for Harlequins' second try and Catrakilis added the extras.
Bath, who have now won only once in their last 13 visits to the Stoop, pushed to get back in the game but rarely troubled the hosts in the second half apart from in the final 10 minutes.
Zach Mercer saw his attempt ruled out by the TMO for being short of the line, while another was chalked off because the grounding was not clear, before Marcus Smith's penalty sealed the home side's victory.
Harlequins director of rugby John Kingston:
"There's some relief after what's gone on in the last two or three weeks where, for a variety of reasons, we haven't performed the way we want to. There's pride in the way that the guys have reacted to the adversity of the recent weeks.
"This week wasn't easy - it wasn't easy for Bath either - but (there were) lots and lots of different things that they've worked to take themselves through.
"Hopefully that will stand us in good stead, but our challenge is to try and get some momentum back into our season and to give us momentum going forward over the course of next year and beyond."
Bath director of rugby Todd Blackadder told BBC Radio Bristol:
"We just didn't play with any structure at times. At times we looked really good and with a structure in place we looked brilliant.
"But at times we looked like we were playing off the cuff and some of those off-loads did not stick today.
"Discipline is the things that is killing us and we have been giving silly penalties away. We have to get our discipline sorted."
Harlequins: Lang; Alofa, Marchant, Roberts, Visser; Catrakilis, Lewis; Lambert, Gray, Collier, Glynn, Horwill (capt), Chisholm, Wallace, Luamanu.
Replacements: Ward, Holenstein, Sinckler, Matthews, White, Waters, Smith, Saili.
Bath: Homer; Banahan, Hurrell, Tapuai, Brew; Wilson, Fotuali'i; Obano, Batty, Thomas, Stooke, Charteris (capt), Mercer, Bayliss, Faletau.
Replacements: Charles, Catt, Lahiff, Ewels, Phillips, Cook, Lewis, Vuna.
Referee: JP Doyle.