Tony Pulis enjoyed a victorious return to the Priestfield Stadium as Stoke hit back from a goal down to open their FA Cup campaign with a comfortable win against Gillingham.
Last season's runners-up, Stoke responded to Danny Kedwell's 16th-minute strike with goals from Jon Walters, Cameron Jerome and Robert Huth to reach the fourth round.
Pulis managed Gillingham between 1995 and 1999, guiding the club to the brink of the Championship before leaving in acrimonious circumstances, which ended in a court case.
Gillingham owner Paul Scally banned Pulis from all areas of the ground except the dug-out and the changing room and wrote in the match programme that he could never forgive the Stoke boss.
But the Gillingham support gave Pulis a standing ovation, which he returned with a wave and applause to all corners of the ground before taking his place in the technical area.
On the field, Stoke arrived with six changes from their victory over Blackburn and last year's FA Cup finalists took time to assert their control.
Gillingham took advantage and earned their reward for a bright start when Kedwell latched on to a loose ball in the box and lashed his shot past Stoke goalkeeper Asmir Begovic.
After a suspicion of handball, Danny Jackman cut inside from the left, Stoke failed to deal with the cross towards Lewis Montrose and Kedwell pounced to score his 11th of the season.
Stoke were standing off Gillingham. Matthew Upson left Jackman clear to swing in another cross and Kedwell just strayed offside before rifling a shot into the side netting.
Rory Delap was booked after hacking Curtis Weston down from behind, having been beaten to the ball in midfield as Gillingham continued to show the greater urgency.
But Stoke turned things around with two goals in quick succession to reach half-time ahead.
Walters played the ball up to Jerome and then continued his run before scuffing a low finish under Ross Flitney, who should have done better in the Gillingham goal.
With Stoke back on level terms, Huth flighted a long ball over Jerome to Walters who picked out Kenwyne Jones at the far post but the striker somehow guided the ball over the bar from point-blank range.
But two minutes before the interval, Ryan Shawcross' near-post flick to Ryan Shotton's long throw deflected off the bar and Jerome was on hand at the far post to tap into an open net.
Stoke came out of the blocks quickly after the interval, with Jones and Shotton combining down the right before Jonathan Woodgate's cross forced Flitney into action.
Jones held the ball up well to feed Shotton, whose strike was turned behind for a corner.
Wilson Palacios picked out Huth in the box and the centre-back rose to plant a commanding header past Flitney to extend Stoke's lead.
Stoke were in control now and almost worked a fourth after a goal-mouth scramble but Flitney produced a brilliant reaction save at the near post to deny Jerome.
Ricardo Fuller was sent on for Jones and lifted the pace, working his way into the Gillingham box but, with Jerome and Walters waiting in the middle, his cross was blocked at the near post.
Walters slipped the ball through to Jerome, who advanced on the keeper but the ball appeared to bobble and the striker's shot flew high over the bar.
Gillingham kept playing with spirit and substitute Luke Rooney forced Begovic into a strong reaction save, with the Stoke keeper turning the ball around the near post.
Referee Mark Halsey waved away Gillingham's penalty appeals when Rooney went down in the box and captain Andy Frampton missed a golden chance to score the Gills' second.
Stoke should have made it four through Fuller, who won his side a corner and was then unmarked in the box but directed his volley over the top.