A relieved Gers midfielder opened the scoring from the rebound in the 25th minute after his penalty had been saved by Accies keeper Luke Southwood.
Hamilton's 19-year-old midfielder Lewis Smith levelled with a drive in the 38th minute but midfielder Joe Aribo struck in the 68th minute, with Colombia striker Alfredo Morelos heading in a third with five minutes remaining.
Arfield hammered in a fourth in added time to give an unfair reflection of the game and put Steven Gerrard's side into Sunday's quarter-final draw.
No Cup tie between these two clubs is complete without reference to Accies famously knocking Rangers out of the Scottish Cup in 1987 but there was to be no repeat, although the home side can take positives from their performance.
Perhaps with a view to the league game against Aberdeen on Tuesday night, Accies boss Brian Rice, sitting in the stand serving a ban for breaching Scottish FA betting regulations, made six changes to his side.
Arfield's first goal came after 17-year-old defender Jamie Hamilton fouled Ibrox striker Morelos as they tangled in the box.
Southwood guessed right at the penalty but the ball came back out to Arfield who knocked it back into the net.
Referee Alan Muir ignored an Accies penalty claim when Dales tumbled inside the box after a challenge by Kent, just before Southwood brilliantly saved a close-range drive from Morelos after he had been set up by Hagi.
Hamilton had to readjust when injured duo Dales and Davies had to go off with injuries with Mickel Miller and Marios Ogkmpoe coming on, but the latter, a powerful striker, soon set up Smith to steer a drive low past McGregor.
Morelos fired over as stunned Rangers responded and Southwood denied Kent just before the interval, with Gers defender Connor Goldson surviving a penalty claim for handball inside the visitors' penalty area sandwiched in between.
Accies suffered another blow when substitute Miller, after picking up a hamstring complaint, was replaced for the start of the second half by Blair Alston, the last of their three substitutes.
Rangers slowly stepped up the pressure in the second-half but the Lanarkshire outfit continued to defend with impressive organisation and determination.
Southwood clutched a 25-yard free-kick from Rangers captain James Tavernier out of the air before Davis replaced Hagi.
Another Gers substitute Greg Stewart, on for Kent, was involved in Rangers' third when his blocked shot spun up into the air with Morelos nipping in to head in from six yards.
Arfield saved the best for last, lashing in a drive from the edge of the box which went in off the underside of the bar.