The draw for the Fifth Round of the Scottish Gas Men's Scottish Cup took place at Dens Park, following Dundee's narrow victory over Dundee United in the Dundee Derby.
Two former Scotland internationals, Alan Hutton and Michael Stewart, joined host Connie McLaughlin to conduct the draw live on Premier Sports.
Championship high-fliers Ayr United were drawn against manager Scott Brown's old side Hibernian in one of the most intriguing ties.
Holders Celtic are at home to Raith Rovers, while last year's beaten finalists Rangers host Queen's Park.
Dundee's reward for their victory over their city rivals is a home tie against Airdrieonians.
Hearts travel to Paisley to face St Mirren in the only all-Premiership affair.
The full confirmed draw is listed below, with the ties to be played on the weekend of Saturday, 8 February.
Former Scotland, Rangers and Aston Villa defender Alan Hutton: "Ayr United against Hibs jumps out for me. That'll be a big match, with Scott Brown and Steven Whittaker managing against their former club.
"It'll be a difficult tie generally for Hibs. They've been going really well at the moment but going down to Somerset Park, it won't be easy and it's a very interesting tie.
"For Callum Davidson - who we've been doing punditry with tonight - I'm not sure if he'll thank me with that draw but it's a brilliant tie for the club going to my old club Rangers."
Former Scotland, Hibs and Hearts midfielder Michael Stewart: "The all-Premiership tie is an interesting one for me with my old club Hearts away to St Mirren. There's never an easy game in Paisley and it's been a disappointing league campaign but if they're able to go there and win it will give them a huge boost.
"Also Raith Rovers get their reward for knocking out Falkirk with a match against Celtic at Celtic Park. They can actually look at the way Falkirk played against Celtic in the League Cup because they set up very well. With Barry Robson being an ex-Celtic player too, there's an obvious connection there as well."
Scottish Gas Men's Scottish Cup Fifth Round Draw
Ayr United v Hibernian
Celtic v Raith Rovers
St Mirren v Hearts
Rangers v Queen's Park
Livingston v Cove Rangers
Aberdeen v Dunfermline Athletic
St Johnstone v Hamilton Academical
Dundee v Airdrieonians