Northern Ireland is set to become the first part of the UK to make paying for sex a criminal offence.
The Human Trafficking and Sexual Services Bill, which includes a clause criminalising payment for sex, has been passed by the Stormont Assembly.
DUP peer Lord Morrow brought forward the Private Member's Bill and it passed its final stage yesterday.
It will now be submitted to the Queen for Royal Assent before becoming law.
The ban will see Northern Ireland implement a prohibition similar to the model in Sweden.
The law change has been hailed by Christian groups but denounced by prostitutes' representatives. Opponents of the clause have argued that it would be difficult to enforce and claimed a ban on paying for sex would push vulnerable sex workers further underground.
Lord Morrow said it was a "momentous day".
"Northern Ireland is now at the forefront of efforts to combat human trafficking and I am very grateful to all those MLAs who ensured there was cross-party support for the Bill," he said.
"To those who were still to be convinced, I hope that time and robust implementation of the legislation will help change their minds."
Lord Morrow told the Assembly his Christian faith had underpinned his decision to bring forward the wide-ranging legislation.
He said human trafficking was "a heinous crime" that had to be tackled in Northern Ireland.
The peer acknowledged that clause 15 of the new legislation, which criminalises those who pay for sexual services, was "clearly the most divisive aspect of my bill".
Alliance justice spokesman Stewart Dickson said later: "It is a source of deep regret for me and my party, however, that the Assembly has proceeded with the inclusion of Clause 15 on the criminalisation of payment for sexual services.
"We believe that this complex issue should have been dealt with in a separate piece of legislation."
His party leader, Justice Minister David Ford, described the bill as "ground-breaking", but said he still had misgivings about the prostitution clause. Mr Ford said it had "diverted the focus away from some of the other important measures and into the moral issues surrounding the purchase of sex."
The proposal to outlaw purchasing sex was among a number of clauses aimed at amending Northern Ireland's laws on trafficking and prostitution. Paid-for consensual sex is currently legal in Northern Ireland although activities such as kerb crawling, brothel keeping and pimping are against the law.