Stephen Flynn asked Rishi Sunak if his government is inspired by Enoch Powell or Nigel Farage during Prime Minister's Questions on Wednesday.
The SNP Westminster leader took aim at Sunak over his Government's small boats plans.
The Government introduced legislation on Tuesday which would mean that asylum seekers arriving illegally in the UK would be detained and face a lifetime ban on returning after they were removed.
They said people who come to the UK illegally would also be denied access to the UK's modern slavery laws.
Enoch Powell was a Tory MP in the post-war period who was most famous for his racist 'Rivers of Blood' speech in 1968. He said immigrants would take control of the country if the numbers of people coming in were not curbed.
Former Brexit Party and UKIP leader Nigel Farage has regularly spoken out against immigration to the UK.
After asking about victims of sex trafficking, Flynn asked Sunak if he was inspired by Farage or Powell.
He said: “I’ll take that as a yes from the Prime Minister that women who are the victims of sex trafficking will not be protected under our modern slavery laws. What a complete and utter disgrace.
“But whilst it may shock, it shouldn’t necessarily surprise because this is the Tory government that in recent months has spoken of invasions.
“Just yesterday, this was a Tory government that said that 100 million people could be coming to these shores and this is the Tory government that this morning said that number could in fact be billions. Complete and utter nonsense.
“So, may I ask the Prime Minister from whom are his Government taking inspiration, Nigel Farage or Enoch Powell?”
Sunak said: "What a load of nonsense. The figure of 100 million it doesn't come from the government. It comes from the United Nations.
"It illustrates the scale of the global migration crisis that the world is grappling with, which is why it is right that we take action, because if we do not, the numbers will continue to grow.
"They have more than quadrupled in just two years. It's a sign of what is to come and our system will continue to be overwhelmed and if that happens, we will not be able to help the people who are most in need of our support, our generosity and our compassion.
"This has always been the way of this country. And once we get a grip of that system, that's who we can extend our support to and that's why it's the right legislation."
Flynn asked Sunak earlier if those who are trafficked to the UK would still be protected under his proposed laws.
He said: "On International Women's Day, can I ask the Prime Minister to reconfirm that under his proposed new asylum laws, a woman who is sex trafficked to the UK, on a small boat, by a criminal gang, will not be afforded protection under our modern slavery laws?"
Sunak replied: "It's precisely because we want to target our compassion and our resources on the world's most vulnerable people that we must get a grip of this system. Make sure that we have control over our borders, make sure our system and resources are not overwhelmed so that we can help the people most in need.
"There is nothing fair there is nothing compassionate about sustaining a system where as we saw recently, people are dying on these crossings. That is not right and our plans will stop that from happening."
To sign up to the Daily Record Politics newsletter, click here.