MPs voted 319-7 in the second and third readings to pass the bill, which will now go to the Senate for final approval. It will become law 90 days after it is published in the Royal Gazette.
Kratom, or Mitragyna speciosa, is a tropical tree, part of the coffee family, with medicinal, stimulant and psychotropic properties. It had been categorised as a Class 5 narcotic, meaning it could not be legally cultivated, imported, exported, sold, possessed or consumed without a permit.
Kratom has long been used in traditional medicine. However, its effects when abused made it popular with young people as a recreational drug, frequently mixed with cough medicine to make a cocktail known as 4x4 - one reason why it was classified as a narcotic.
Justice Minister Somsak Thepsutin, who chaired the committee scrutinising the bill, told lawmakers that removing kratom from the narcotics list would ease the burden on law enforcement of arresting and taking action against those using it.
Kratom has the potential to be a new cash crop for farmers, he said.
Authorities handle about 15,000 cases related to kratom each year, the minister said on Jan 15 during a meeting with committee members to finalise the bill after it passed the first reading last month.
The 90-day delay before it comes into force will give MPs enough time to consider another relevant piece of legislation, the kratom bill, required to govern its use.
The cabinet agreed in principle to the kratom bill in October. It will soon be submitted to parliament.
Details of the draft act include bans on selling it to people under 18, on advertising and on mixing kratom with other drugs or stimulants to make it a recreational drug.