Philippine President Rodrigo Duterte gestures as he arrives to visit the Bureau of Jail Management and Penology on the outskirts of Manila on Oct. 18. (Aaron Favila/AP)

ERRATIC, PROFANE and crude, the president of the Philippines, Rodrigo Duterte, is a person to whom the old adage applies: Watch what he does, not what he says. In his first year in office, he launched a nationwide extrajudicial campaign against suspected drug dealers and users in which thousands of people were killed, often by police or by vigilantes on motorcycles without due process or protection of their rights. Now, Mr. Duterte has said he may end the awful campaign. Let's hope he means it.

Mr. Duterte won the presidency last year with fiery promises to go after drug abusers much as he had pursued criminals as mayor of the southern city of Davao, where armed vigilantes turned into death squads. In his final campaign rally in 2016, he declared if elected president, he would kill criminals and "dump all of you into Manila Bay, and fatten all the fish there."

Once he was in office, a violent campaign unfolded in which at least 5,000 and perhaps many more people were killed by police and by vigilante squads. Mr. Duterte retained high public approval ratings and brushed off international criticism of his brutal methods.

But more recently, public outrage erupted after closed-circuit video footage showed how a 17-year-old student, Kian Loyd Delos Santos, was dragged by police toward where he was shot dead on Aug. 16. The event triggered a large opposition rally and led to an investigation by the National Bureau of Investigation. The young man was one of 82 people killed from Aug. 15 to Aug. 16, part of one of the deadliest weeks in the drug war.

An early October poll suggested that Mr. Duterte's approval ratings were sagging and that he had especially suffered among poor people who were once a bulwark. Risa Hontiveros, an opposition senator, told the Financial Times recently that the poll numbers were an "ominous warning" and added, "There are deep and widening rumblings of discontent across different social classes and all over the country with rampant killings, fake news and numerous accusations of corruption."

On Oct. 10, Mr. Duterte made a decision to effectively pull the 160,000-strong national police off the drug war and turn it over to the Philippine Drug Enforcement Agency, which has only about 1,800 officers. This suggested that the president may be pulling back from the indiscriminate campaign on the streets; Mr. Duterte said the drug agency would be ordered to go after "big fish," networks and suppliers. Mr. Duterte made a similar shift in January, then rescinded it five weeks later. The hope is that this time he is serious.

His motivation may be, in part, President Trump's expected visit in November. Mr. Duterte, who spat insults at President Barack Obama, has made a determined effort to redirect Philippine foreign policy toward China and Russia. Mr. Trump, who has an unabashed affinity for crude strongmen, should do what he can to bring Mr. Duterte back toward the United States and discourage him from resuming the extrajudicial drug war.