A murdered Philippine politician caught his killer on camera just moments before he was shot dead, with the photograph leading to the arrest of the gunman, police said.

The photograph, taken by district councillor Reynaldo Dagsa and reprinted on the front page of a major newspaper, shows his family posing for the photo while the gunman is in the background aiming a pistol at his victim.

"While he was taking the picture of his family on New Year's Day, the killer appeared and he inadvertently took the picture of the killer with the gun aimed at him," local police chief Jude Santos said.

Mr Dagsa, a councillor in a Manila suburb, was shot moments after the picture was taken and died on the way to the hospital, according to Mr Santos who is investigating the case.

The family gave the photograph to the police, leading to the arrest of the gunman on Monday.

Police also arrested a suspected accomplice who was seen lurking in the background of the picture.

The suspects may have had a grudge against the councillor who was active in law enforcement activities in his district, said the police chief.

Rampant gun violence has long plagued the impoverished Philippines, with a vast array of cheap firearms easily available on the legal and black markets.

- AFP