Newport took the lead in the 33rd minute when captain Joss Labide let fly from 25 yards and the skipper’s shot squirmed under the body of goalkeeper Rob Green on his first start of the season.
But Roofe drew United level two minutes before the break when hammering home from a Stuart Dallas corner before firing United ahead just four minutes after the break after a Dallas cross.
And just moments after Roofe had hit the crossbar with a lovely lob, the forward completed his treble in even better style two minutes later with a brilliant bicycle kick five minutes after the hour.
Substitute Samuel Saiz then powered home United’s fourth with 13 minutes left before Ronaldo Vieira brought up the Whites nap hand in the final minute.
"I had some strong words at half time, I wasn't happy with our performance,” said Whites head coach Thomas Christiansen.
"In the second half, our quality came through and I was very satisfied. It was great for Kemar to score three goals, but also very important for the team.
"I don't have a preference for who we face in the next round, but another home draw would be nice"
Christiansen gave full debuts to Eoghan Stokes and Madger Gomes and Gomes went close after just three minutes when dragging a long-range effort just wide.
Green then saved United’s skin in the ninth minute when the goalkeeper pulled off a terrific save to palm a low effort from Sean Rigg just wide in the ninth minute.
But after Shawn McCoulsky’s fierce volley was headed off the line by Vurnon Anita, Newport went on to take a 33rd-minute lead.
There appeared little danger as Labadie had a crack at goal from 20 yards and Green looked to have made a comfortable save but the ball squirmed underneath the ‘keeper and into the back of the net.
Leeds, though, drew level two minutes before the interval when a Dallas corner eventually found Roofe who fired home close range after Conor Shaughnessy’s free header had been punched off the line by Joe Day.
And within four minutes of the second half Leeds were in front via Roofe’s second goal of the game.
A clever pass from Luke Ayling fed Dallas whose cross from the left was deflected but only into the path of Roofe who volleyed home a no-nonsense finish past Day.
Newport went close to immediately equalising when a long shot from Lamar Reynolds trickled just wide but Roofe then came within inches of sealing his hat-trick when a delicious lob from 25 yards dropped on to the crossbar.
But there was no denying the Whites forward just two minutes later as he produced a superb bicycle kick from Ayling’s cross to net his third goal of the game.
To make matters worse for Newport, Christiansen then brought on Samuel Saiz for Stokes and Saiz immediately set up Dallas who fired just wide.
Within 13 minutes of coming on, Saiz bagged United’s fourth as the Whites piled forward and the ball broke to the Spaniard who smashed the ball home from just inside the box.
Both sides then had plenty of chances in the final ten minutes but it was United who bagged a fifth when Vieira converted with a smart finish in the final minute that went in off the post.
Leeds United: Green, Ayling, Borthwick-Jackson, Shaughnessy, Anita (Cooper 60), Klich, Vieira, Gomes, Dallas, Stokes (Saiz 65), Roofe (Alioski 75). Subs not used: Peacock-Farrell,O’Connor, Phillips, Wilks.Newport County: Day, Demetriou, White, O’Brien, Pipe, Willmott, Dolan, Labadie, Rigg (Tozer 73), McCoulsky (Noble 54), Reynolds. Subs not used: Bittner, Butler, Bennett, Cole, Quigley.Referee: Ross Joyce.Attendance: 17,098.