The new law only permits married Thai couples, or couples with one Thai partner, who have been married for three years to use a surrogate.
The legislation bans commercial surrogacy, particularly the use of agents or anyone promoting women who are willing to carry babies. The maximum sentence is 10 years.
The law comes after a comes after a number of high profile cases including an Australian couple who left a child with Down's syndrome with the surrogate mother but took home his healthy twin sister.
Concern about the industry worsened when a Japanese man was found to have fathered more than a dozen babies by different Thai surrogates, a case later dubbed "the baby factory", according to the BBC.
Lawmaker Wanlop Tangkananurak said the law - which was first read in parliament in November - aimed to prevent Thailand from being "the womb of the world".
The new law may also exacerbate the situation of a gay American Spanish couple who are embroiled in a legal battle over their daughter. The surrogate refused to sign documents to allow the baby girl to get a passport after finding out the couple are gay.
The couple have been living, together with the daughter and their 23 month old son, in fear in a secret location in Bangkok, afraid that the surrogate mother will track them down.