Rangers have been handed a home tie against Motherwell in the William Hill Scottish Cup fourth round while Celtic will travel to either Queen of the South or Albion Rovers.
Mark Warburton's side host Well in one of only two all-Premiership ties, as Kilmarnock also take on Hamilton, with Celtic, fresh from their Betfred Cup triumph at Hampden on Sunday, pitted against either Championship or League One opposition for a spot in the fifth round.
The Ibrox side met Motherwell in the group stages of the League Cup at the start of the season with Rangers winning 2-0.
Holders Hibernian have been handed an away tie at either junior side Bonnyrigg Rose or fellow Championship outfit Dumbarton, while Aberdeen will host either Stranraer or East Kilbride, who recently broke Ajax's world record for consecutive victories.
Ross County face a potentially tricky tie against Dundee United, who sit three points behind leaders Hibs in the Championship, with Hearts also facing a tough trip away to Raith Rovers.
St Johnstone will welcome either Forres Mechanics or Stenhousemuir to McDiarmid Park, while Dundee will play St Mirren or Spartans.
Inverness face the relatively short trip to play Elgin City, while fellow Premiership side Partick Thistle will play Formartine United or Annan Athletic.
The ties will be played on the weekend of January 21/22.
William Hill Scottish Cup fourth round draw
Ross County v Dundee United
St Johnstone v Forres Mechanics or Stenhousemuir
Albion Rovers or Queen of the South v Celtic
Livingston v East Fife or Edinburgh City
Rangers v Motherwell
Aberdeen v Stranraer or East Kilbride
Elgin City v Inverness
Raith Rovers v Hearts
Kilmarnock v Hamilton
Bonnyrigg Rose or Dumbarton v Hibernian
Brechin City or Ayr United v Queen's Park or Montrose
Partick Thistle v Formartine United or Annan Athletic
Stirling Albion or Wick Academy v Clyde or Arbroath
Alloa Athletic v Dunfermline Athletic
Dundee v St Mirren or Spartans
Beith Juniors or Greenock Morton v Falkirk