A man pleaded guilty Wednesday to helping smuggle dozens of people from Pakistan and Afghanistan into the United States by way of dangerous treks through Brazil and Latin America.

Sharafat Ali Khan, 32, described by prosecutors as a Pakistani national and former resident of Brazil, pleaded guilty to charges of conspiracy to smuggle undocumented migrants into the United States for profit.

Prosecutors say he schemed with others to bring people from Pakistan and elsewhere through Brazil and Central America into the United States by planes, buses and on foot. At least 81 people identified Khan as the person who helped facilitate their travel from Brazil to the United States between May 2014 and June 2016, according to court records.

Prosecutors say Khan managed safe houses for the travelers and arranged for people in other countries to serve as their escorts on different legs of the route. He told prosecutors the voyage included long hikes with little food and water through the remote tropical forest of Darien Gap, on the border of Colombia and Panama.

Court records show the travelers paid between $5,000 and $12,000 each before their journeys, which sometimes included long days of walking through the jungle.

Khan is set to be sentenced in July.