MANILA — A Philippine congressman was shot and killed on Saturday, in an attack the police suspect could be politically related ahead of elections next year.

The lawmaker, Rodel M. Batocabe, 52, an ally of President Rodrigo Duterte, was shot eight times during a gift-giving ceremony for older Filipinos in the eastern Albay Province, according to Senior Inspector Mayvell Gonzales of the local police. A police escort was also killed.

Mr. Batocabe was the first member of the Philippines’ 297-seat House of Representatives to be killed in recent years, but he was the 21st official murdered since Mr. Duterte took office two years ago and began a brutal anti-narcotics crackdown.

At least three of those killed were on a long list of officials whom Mr. Duterte has accused, without providing evidence, of involvement in the drug trade.