Thailand’s parliament has passed legislation banning commercial surrogacy, putting a halt on foreign couples seeking to have children through Thai surrogate mothers.

The issue of surrogacy was in the spotlight in Australia last year after a Western Australian couple were accused of leaving a twin boy, known as Baby Gammy, with his surrogate mother after they discovered he had Down syndrome.

The legislation passed by Thailand’s national legislative assembly on Thursday closed loopholes in the country’s public health laws that enabled commercial surrogacy to thrive, reported theguardian.

The new law bans all foreign and same-sex couples from seeking surrogacy services in the country.

Only married heterosexuals with at least one Thai partner are allowed to use surrogates. There are no fees allowed for the service and the surrogate mothers must be Thai and over 25 years old.

The surrogate mothers are also required to be relatives of either the husband or wife.

The legislation also includes a ban on advertising and promotions, and shuts down surrogate agents and unregistered clinics.

The Baby Gammy case made headlines in August 2014 when Thai surrogate Pattaramon Chanbua alleged West Australian couple Wendy and David Farnell had abandoned Gammy and returned to Western Australia with his healthy twin sister, Pipah.

Farnell, a convicted child sex offender, retained custody of Pipah late last year after an investigation by the WA Department for Child Protection.

Through the support of charities and the public, Gammy and his surrogate mother and her family have a new home in Thailand’s Chonburi province and he is receiving the medical treatment he needs.

Pattaramon also applied for Australian citizenship for Gammy and it was granted last month.

Officials from Australia’s Department of Foreign Affairs (Dfat) said last year up to 150 Thai surrogate mothers carrying babies for Australian couples were expected to give birth by the end of 2015.

Dfat officials have negotiated with Thailand for a transition period to enable the children and their Australian parents to depart Thailand.