In response, Southeast Asian governments issued waste-import restrictions of various shapes, sizes and durations. Thailand imposed an indefinite ban on electronic waste last summer, for example, while Vietnam stopped issuing waste-import licenses and vowed to stop importing scrap plastic by 2025.

In the Philippines last week, officials returned a shipment of waste that had been mistakenly sent there from Canada several years ago, and vowed to send another back to Hong Kong.

“Load that up on a ship and I will advise Canada that your garbage is on the way,” President Rodrigo Duterte of the Philippines said of the Canadian shipment in early May. “Prepare a grand reception. Eat it if you want to.”

In Malaysia, the campaign against imported waste has been led by Yeo Bee Yin, the 36-year-old environment minister. On a trip last week to Port Klang, down the road from Telok Gong, she said the government would soon return 10 of about 60 containers with waste from the United States and elsewhere that had been smuggled into illegal processing facilities.

Ms. Yeo’s campaign may be a way to score public relations points against countries, including the United States, that have criticized Malaysia for its high rates of deforestation and other severe environmental problems, said Helena Varkkey, an expert on pollution in Southeast Asia at the University of Malaya in Kuala Lumpur.

“This is a ‘Here’s a taste of your own medicine,’” she said. Ms. Yeo’s office could not be reached for comment.