The bill was backed by the Conservatives and Labour, with the Greens and Liberal Democrats opposed.

Tory justice spokesman Liam Kerr described the bill as “flawed”, citing concerns from Police Scotland, external that the proposed legislation would have cost up to £321m a year to enforce.

However, he urged MSPs back the proposals at stage one as part of efforts to reduce violence against women and girls.

Labour’s Pauline McNeill, backing the bill, said there was an “uneven power dynamic” within prostitution “where it is overwhelmingly women who are exploited and men causing harm”.

She said prostitution was not a “true choice” for women who are “driven into sex work through poverty and other traumatic circumstances”.

Speaking against the bill, Green MSP Maggie Chapman said: “Where sex work happens between consenting adults, I believe the state should support people not penalise them for how they choose to live.”

The Liberal Democrats also opposed the bill. Party leader Alex Cole-Hamilton said evidence from other countries, such as Australia, suggested criminalisation can result in increased marginalisation and additional barriers to accessing support services.

“We can’t wish prostitution away and as it will forever exist we need to make sure it happens in the safest possible way,” he told MSPs.

However, Regan insisted that the “Nordic model” proposed in her bill was the only way to reduce harm.