Substitute Eros Pisano's 80th-minute goal gave play-off hopefuls Bristol City a vital 1-0 win at Blackburn.
The Italian defender, brought on to replace the booked Bailey Wright to protect him from a red card, made the telling contribution when he prodded home from close range.
It was enough in a game of fine margins dominated by defences; the visitors fashioned the better chances, but nothing clear cut.
But it is easy to see why the Robins have the second-best defence in the league - their centre-backs were imperious and when they were not in the way, Frank Fielding was, denying Bradley Dack in the second half.
The win continues a remarkable run of form for Lee Johnson's men - they remain sixth after an eighth straight win in all competitions, and they are unbeaten since November.
It was a blow to Blackburn, who are now seven points off the top six after a second successive defeat which also ends their three-game winning streak at home.
Captain Charlie Mulgrew returned to replace the injured Darragh Lenihan, while Richie Smallwood stepped in for Corry Evans - also injured - from defeat at Brentford.
The Robins were unchanged following victory over Swansea.
The opening exchanges were keenly contested by two well-matched sides, but the hosts came closest to a goal in the 15th minute, when Harrison Reed was agonisingly out of reach of Dack's deflected cross when any touch would do.
Andreas Weimann broke a long goal drought last week and went for another with a speculative low drive that David Raya tipped away.
Championship Player of the Month Adam Armstrong saw a rasping snapshot parried by Rovers' academy graduate Fielding, before Elliott Bennett heroically blocked a goalbound Famara Diedhiou volley.
The Robins missed a glorious chance end the stalemate but their top scorer Diedhiou headed over a Jamie Paterson corner when unmarked just six yards out.
Rovers started the second half strongly but were reliant on Raya in the 51st minute, as the Spaniard tipped over Diedhiou's far-post header, before Williams saw a header of his own fly over minutes later from a superb Mulgrew cross.
A moment of class from Dack 22 minutes from time almost broke the deadlock, as he delightfully controlled Armstrong's pass, sidestepping a challenge before forcing Fielding into a smart near-post save.
But the Robins finally broke the deadlock 10 minutes from the end when Pisano met Callum O'Dowda's corner six yards out, beating Blackburn defenders to the ball to steer it past Raya for his second goal of the campaign.
And despite late pressure, City held on for their first Ewood Park win since 1990.
The managers
Tony Mowbray: "It was always going to be a tough game, a team that have won a lot of games on the bounce, have a lot of confidence. We knew it was going to be tight. We talked about it being a game we could win 1-0 with a set-play, a bit of magic from Bradley Dack, free-kick from Charlie Mulgrew.
"Ultimately it wasn't to be. They've got some very good defenders, carry a physical threat at the top end of the pitch. I thought we worked extremely hard, had spells in the game when we were on top. There was one instance in the second half where we had four or five shots. It wasn't to be our day."
Lee Johnson: "I think we showed against a very good side with a fantastic home record that we could do both sides of the game.First half, we were very slick on the counter from that middle third but lacked a bit of quality in the final third.
"Second half, we dug in. The pitch got churned up, they've got good players. I think Tony Mowbray has done a great job with the resources he's got, and obviously getting promoted. It was always going to be a tough game. We talked before the game that defences would be important because of both teams' attacking threat. I think that showed and we were lucky enough to earn the right to score the winner from the set-piece."