Gloucester edged a hard-fought tussle with London Welsh to extend their unbeaten Premiership run to four games.
Shane Monahan and Tom Savage tries, added to Freddie Burns' eight points gave Gloucester an 18-9 half-time lead.
Welsh's Gordon Ross, who kicked three penalties in the first half, repeated the feat in the second, with Franck Montanella scoring a converted try.
However Billy Twelvetrees' penalty, Shaun Knight's try and further penalties from Burns sealed the win.
The Exiles came into the game on the back of wins against Sale and Exeter Chiefs, and competed well early on as Burns and Ross traded penalties.
However the visitors landed the first telling blow when Burns struck his second penalty before producing two moments of brilliance to create the opening try.
The fly-half launched a break from deep, sidestepping the Welsh defence and only Nick Scott's deliberate batting down of the scoring pass prevented a try.
The Exiles wing was sent to the sin bin and Burns caught the hosts in disarray as he took a quick tap to allow Monahan to get over on the right.
Ross responded with a penalty for Welsh but it was a brief reprieve as more good work from Monahan and wing partner James Simpson-Daniel laid the platform for Savage to barge over.
Two further penalties saw Ross add to the scoreboard, with Burns sin-binned but Welsh infringed moments later after failing to secure their own line-out ball and Billy Twelvetrees restored the nine-point gap.
The Cherry and Whites struggled to contain the Exiles rolling maul, and surge led to Ross' fifth penalty, before a drive saw Montanella adjudged to have grounded the ball in-goal amid the bodies.
A successful conversion from Ross and a penalty looked to have handed the hosts in a winning position with just over a quarter of an hour to go.
But it was not to be as Burns - back on the field - replied with his third penalty and then created Knight's winning try to crown another stellar performance at outside half.
VIEWS FROM THE DRESSING ROOM
London Welsh coach Lyn Jones:
"We didn't kick well in the first half, and that brought Gloucester into the game.
"As a result they managed to score two good tries, so turning round 18-9 down with couple of bad injuries, you are up against it.
"We showed some spirit and came back, we managed the game well and got our noses in front, but we had a penalty advantage before the break in front of the posts that went begging and there was one with 15 minutes to go that we failed to deal with.
"We had our opportunities but it wasn't to be today. You have to deal with ups and downs of the season but I think the boys are frustrated and disappointed as it was within our grasp but we need to learn how to play accurately."
Gloucester director of rugby Nigel Davies:
"I have worked with a lot international 10s and he [Burns] is certainly up there that's for sure, and the fact he has been able to mature at this level for a couple of years has certainly helped him.
"As a 10 it's not all about you, it's about the team and how you run the team and he is starting to do that for us now.
"A game like this can be very difficult for you if you don't get it right at number 10.
"But for large parts of the game he controlled the game, put us in the right areas and he was a constant threat.
"His goal-kicking is improving all the time and his out of hand game management and kicking is excellent at the moment too, so he is really maturing."
London Welsh: Jewell; Arscott, Parker, Tonga'uiha, Scott; Ross, Keats; Montanella, Briggs, Ion; Mills, Corker; Browne, Hills, Jackson.
Replacements: Runciman for Jewell (76), Mackenzie for Parker (20), To'oala for Ross (76), Bristow for Montanella (66), George for Briggs (11), Jolly for Ion (52), Kulemin for Browne (75).
Gloucester: Cook; Monahan, Twelvetrees, Tindall, Simpson-Daniel; Burns, Robson; Wood, D'Apice, Harden; Savage, Hamilton; Buxton, Qera, Kalamafoni.
Replacements: Lewis for Tindall (63), Trinder for Robson (63), Murphy for Wood (64).
Sin Bin: Burns (42).
Ref: Llyr Apgeraint-Roberts (RFU).