Sergio Aguero scored his sixth goal in his last three games as Manchester City edged a gutsy Sheffield United at Bramall Lane.
The Blades had looked on course to claim a hugely credible draw against the reigning Premier League champions, with Dean Henderson saving a Gabriel Jesus penalty in the first half as well as making a string of excellent saves.
But Aguero came off the bench to score the decisive goal, tapping in a cross from Kevin de Bruyne towards the end of the second half.
That strike came just moments after Sheffield United came close to taking the lead themselves - Oli McBurnie stretching to meet a cross but just failing to turn the ball into an empty net.
Victory for Manchester City means they strengthen their place in second. They have 51 points - 13 behind leaders Liverpool but six ahead of Leicester, who play West Ham on Wednesday.
Sheffield United, meanwhile, remain seventh on 33 points.
It is hard to imagine that a manager who has won trophies wherever he has worked is claiming he can still learn from others, but that's exactly what Pep Guardiola said prior to this game.
The former Barcelona and Bayern Munich boss spoke highly of Sheffield United under Chris Wilder, saying they are a team he can learn from.
For large periods of this game the Blades certainly gave Guardiola plenty to think about, with their disciplined and organised defence frustrating City for well over an hour.
In the end, Guardiola had to turn to the ever-reliable Aguero to get the job done.
At 31, the Argentina international is in the twilight years of his football career but is arguably enjoying some of his best form.
It took him just six minutes to get on the scoresheet after coming on for Jesus, who had struggled to get the better of the Blades' defence.
Aguero has now scored 21 goals in just 23 appearances in all competitions this season, including eight in his last five appearances.
The league title may be increasingly out of reach for City but Aguero's form could be vital for their aspirations in other competitions.
Just as crucial, though, could be the return of Aymeric Laporte. Injuries have meant Guardiola has often had to field a makeshift defence this season but Laporte made a surprise return at Bramall Lane after five months out with injury.
The result was a first clean sheet since City hosted Sheffield United at the Etihad at the end of December and Guardiola was delighted with the French player's return.
"We miss him the lot," he said. "Imagine if the best teams in the world lose their best central defenders.
"We knew he could not play 90 minutes. He is an incredible guy. He was exceptional. It is good news for us."
Laporte played for 78 minutes on his return from a 143-day lay-off
It is difficult to find different superlatives to describe Sheffield United in the Premier League this season.
Match after match they produce impressive performances, frustrating supposed bigger sides and, rather than being sussed out in the second half of the season, they are seemingly finding new ways to keep their opponents on the toes.
That was the case once again on Tuesday night. At the start of the season, Sheffield United fans could have been forgiven for spotting this game on the fixture list and fearing a cricket score, but instead their side showed no fear and went toe to toe with their opponents from the outset.
They were strong in the tackle and organised in defence. On the few occasions Manchester City did get through they found Henderson in inspired form.
The goalkeeper made a superb stop to deny Raheem Sterling from close range in the first half before then guessing the right way to keep out Jesus' spot kick.
That save prompted chants of "England's number one" from the home fans and this performance will have only increased his chances of being included in Gareth Southgate's squad for Euro 2020 this summer.
Dean Henderson has saved four of his last eight penalties faced in English league football
Manchester City manager Pep Guardiola, speaking to Match of the Day: "We knew it would be a difficult place to come. We concede one or two clear chances, nothing more than that.
"In the first half, the keeper was excellent with the penalty and two incredible saves, it was an incredibly good victory for us to take a step towards securing Champions League football next season.
"In the first half we were a little bit shy to play, but in the second half we were a little bit more like we are. But we controlled it really well, the chance to score goals.
"What Sheffield United do, they do it perfectly. They've been together for five years so their spirit is so good. They are so good at the second balls and arrive with a lot of people in the final third."
Sheffield United manager Chris Wilder, speaking to Match of the Day: "Kevin de Bruyne has found an amazing pass and the movement of Sergio Aguero, he's done that to everyone in Europe and the world, it's a great finish.
"I've got nothing but an enormous amount of pride for my team, we went toe-to-toe with them.
"When opportunities arise you have to show a little bit of quality and we didn't do that sadly. Games like this are what we're here for, we've worked really hard to get here, we want no regrets and I don't think there were any tonight.
"When teams come here, we want to make sure they go through the mixer to get a result and I do believe Pep, his staff, the players and the fans will believe it's been a difficult night for them."
Sheffield United travel to Championship side Millwall on Saturday, 25 January (15:00 GMT), while Manchester City host Fulham on Sunday, 26 January (13:00 GMT).