BANGKOK — A court in Thailand convicted dozens on Wednesday of organizing a human-trafficking ring that enslaved hundreds of people. Many victims were found buried in a mass grave near a secret jungle camp in which they had been imprisoned, tortured and held for ransom.

The defendants included a high-ranking officer, Lt. Gen. Manas Kongpan, and Pajjuban Aungkachotephan, a businessman and former politician, as well as police officers and smugglers from Bangladesh, Myanmar and Thailand.

General Manas was convicted of trafficking and of committing an organized transnational crime, and he was sentenced to 27 years in prison; Mr. Pajjuban received a 75-year sentence.

The defendants were arrested in 2015 after 36 bodies were found in shallow graves near the border with Malaysia. The discovery led to efforts to dismantle a multimillion-dollar smuggling enterprise, and the traffickers soon abandoned their human chattel in jungle camps or in crowded vessels adrift in the Andaman Sea.