A Philippine mayor on President Rodrigo Duterte's list of allegedly narcotics-linked officials was shot dead by a "sniper" in a daylight attack at a town ceremony, police said.

Antonio Halili was hit in the chest by a single shot fired from a distance, unleashing chaotic scenes during the weekly flag raising ceremony at the town hall in Tanauan, south of Manila.

In the moments that followed, terrified onlookers screamed and the mayor's security details opened fire, video of the scene showed.

However, the shooter managed to escape and Mr Halili was pronounced dead at hospital.

Police chief Renato Mercado said the shot was fired from about 150 metres away and said he believes a "trained sniper" was responsible.

The controversial Mr Halili had compared himself to Mr Duterte as he publicly shared the president's hardline position against crime and illegal drugs.

But in 2017, Mr Halili's name surfaced on a "narco-list" presented by Mr Duterte, of officials allegedly linked to narcotics.

He was stripped of control of the police following the publication of the list, but he denied any ties to drugs.

Though the Philippines sees occasional killings of local politicians, the brazen nature of the killing and links to Mr Duterte's drug war drew outrage.

"This is clearly another case of EJK (extra-judicial killing) resulting from the so-called drug war launched by the government," opposition leader Senator Francis Pangilinan said in a statement.

"It is this Philippine image of a 'wild, wild west' that has also dampened the desire of both foreign and local investors," he added.

The government has said that more than 4,200 suspects have been killed as part of the war on drugs that is the centrepiece of Mr Duterte's administration.

But rights groups charge that the actual death toll is three times higher and that the police and shadowy vigilantes are murdering people even without proof they are linked to drugs.

Three other mayors on the "narco-list" have been shot dead, one of them while being held inside a jail cell.

Mr Duterte's spokesman Harry Roque condemned the crime and praised Mr Halili as the mayor of "one of the most progressive towns," in his province.