A Philippine city mayor known for parading drug suspects in public, but also alleged to have drug ties himself, has been shot and killed by a sniper in a brazen attack in front of hundreds of horrified employees and village leaders during a flag-raising ceremony.

Key points: The gunshot was apparently fired from a grassy hill

The gunshot was apparently fired from a grassy hill The gunman has not been arrested

The gunman has not been arrested Tanauan is a small city about 70 kilometres from Manila

The apparent lone gunshot felled Mayor Antonio Halili of Tanauan city in Batangas province south of Manila as he and about 300 employees and newly elected village leaders sang the national anthem in a car park outside the city hall.

The gunman escaped, police and witnesses said.

"I didn't know that it was gunfire until people started screaming, 'somebody's shooting, somebody's shooting' while running in all directions and I saw my Mayor slumped on the ground," said village leader Rico Alcazar, who was in a crowd standing behind the 72-year-old Mr Halili.

"Everybody was shocked and it took sometime before some carried the Mayor and brought him away in a car."

Mr Halili's bodyguards opened fire toward a grassy hill where the gunshot was apparently fired, adding to the bedlam, Mr Alcazar said.

Mobile phone video shot by Mr Alcazar shows a few men standing around the fallen Mr Halili as gunfire rings out continuously and people cry, scream, run and take cover during the melee.

A man yells, "the Mayor is dead, the Mayor was shot", and another desperately calls for a car to take Mr Halili to a hospital.

"They did not see anybody approach him," the national police chief, director-general Oscar Albayalde, said at a news conference in Manila, adding that an investigation was underway.

"They just heard a gunshot, so the assumption or allegation was it could have been a sniper shot."

The bullet hit a mobile phone in Mr Halili's coat pocket then pierced his chest, police said.

Policemen scoured the hill but failed to find the gunman.

The mayor (third from right) was shot as village leaders sang the national anthem. ( AP: Tanuan City Information Office )

Mayor's 'walks of shame'

Philippine President Rodrigo Duterte expressed suspicion in a speech that the killing was linked to illegal drugs.

Two years ago, Mr Halili ordered drug suspects to be paraded in public in Tanauan, a small city about 70 kilometres south of Manila, in a campaign that was dubbed "walks of shame".

The suspects were forced to wear cardboard signs that read, "I'm a pusher, don't emulate me", in a campaign that alarmed human rights officials.

Officials, however, also linked Mr Halili to illegal drugs and removed his control over city police.

Mr Halili strongly denied the allegation and said at the time that he would resign and would be willing to be publicly paraded as a drug suspect if authorities could come up with evidence to support the allegation.

Tanauan information officer Gerardo Laresma said Mr Halili had received death threats "left and right" from unknown people prior to the attack.

Mr Halili's unusual campaign drew attention at a time of growing alarm over the rising number of killings of drug suspects under Mr Duterte.

Since Mr Duterte took office in 2016, more than 4,200 drug suspects had been killed in clashes with police, alarming human rights groups, Western governments and UN rights watchdogs.

An investigator walks along the area where the sniper was believed to have taken up their position. ( AP: Aaron Favila )

AP