Doncaster Rovers came close to giving Premier League Stoke an FA Cup fright at the Keepmoat Stadium.
Stoke took the lead on 15 minutes, despite a fluent start for the hosts.
Andy Williams had brought a save from Jakob Haugaard, and League One side Doncaster had looked comfortable.
But Joselu broke down the right flank, and his cross picked out former England striker Peter Crouch who stabbed the ball beyond Thorsten Stuckmann.
Rovers top scorer Andy Williams had a great chance to level when the ball broke to the striker, but his effort was straight at Haugaard.
But parity was restored on 25 minutes. Nathan Tyson saw his original shot blocked, but he was altert enough to follow-up and divert the ball into the net.
Rovers were more than holding their own, and Craig Alcock tumbled in the box but the penalty appeals were ignored.
Stuckmann denied Diouf before Crouch blazed over, although the striker was offside.
But Stoke did go back in front, and it was a superb strike from Jon Walters who fired home from 25 yards.
Rovers came close to an equaliser when Williams’s header bounced back off the crossbar.
Then late on, Doncaster had two fines chances for an equaliser. First, substitute Gary MacKenzie headed down, but Tyson scooped the ball over, before Andy Butler headed over.
Stoke boss Mark Hughes admitted his side “rode our luck” to reach the FA Cup fourth round.
Hughes said: “We rode our luck with a few chances Doncaster had and on another day they could have fallen more kindly for them and might still have been in the hat.
“But we will take any fortune that comes our way. You always understand when you’re the away side the home side will have a go to get back in the game and it was a good cup tie.
“I thought Doncaster caused us problems and it has taken two good quality goals from us to take the tie away from them.”
Hughes said his decision to make nine changes was out of necessity due to his side’s busy schedule but he denied his reshuffle disrespected the competition.
Hughes added: “This was the only opportunity between now and mid-March where we could rest some key players but I still had nine full internationals out there which showed our strength in depth.”
Rovers boss Darren Ferguson bemoaned his side’s missed opportunities and a second-half penalty appeal after Alcock tumbled in the box.
Ferguson said: “It was a proper Cup tie that went to the wire and we had two great chances at the end but you have got to take them.
“It’s really frustrating to think we did so well but we lost. I’m not disappointed with the performance at all, but I am with the result.”
Referring to Joselu’s challenge on Alcock, Ferguson added: “The key decisions did not go our way.
“The centre-half has grabbed our striker by the throat. It might be seen as sour grapes but it’s not because I am just looking at the performance of our players.”
For Ferguson attention will quickly turn to next week’s game with Gillingham when his side will look to boost their play-off prospects with a third consecutive League One win.
Ferguson added: “The game next Saturday was always going to be a lot bigger than this one because the league is always the priority.
“But I think the players showed the belief that they could win today, especially after going behind twice, so it was a pleasing performance.”