Rose Furigay, the former mayor of the southern Lamitan city, was attending her daughter’s graduation at the law school of Ateneo de Manila University in Quezon City when the shooting took place, leaving her and two others dead.
Those killed include a campus security officer and an unidentified male, the police said.
Two people were injured, including Furigay’s daughter whose condition is now stable, officials added.
“We are quite distraught and bereaved by this occurrence,” Joy Belmonte, the mayor of a local government unit, told AFP.
The suspect, identified as Chao Tiao Yumul, was injured in a shootout and was taken into custody after a car chase, said Quezon City police chief Remus Medina.
He added that the killing appeared to be a targeted assassination of the former mayor.
“He looks like he was a determined assassin,” he said, adding that law enforcement officials reportedly recovered two pistols from him.
The suspect accused the mayor of being a “drug lord” and claimed that Furigay’s family had ordered three attacks on him.
The suspect is a native of Lamitan city in Basilan province, which is a stronghold of pro-Islamist State extremist group Abu Sayyaf and is known for its banditry and kidnapping.
Philippines chief justice Alexander Gesmundo was on his way to speak at the ceremony moments before the shooting. The school cancelled the graduation ceremony subsequently.
Furigay served three terms as mayor and was prevented by the constitution from seeking re-election. She was, however, succeeded by her husband, who also held the position before her.
“We commit our law enforcement agencies to thoroughly and swiftly investigate these killings and bring all involved to justice," Philippines president Ferdinand Marcos Jr said in a statement.
Known for the sporadic shooting incidents, the Southeast Asian nation requires owners to have permits to carry guns in public. Private security officers carrying handguns and shotguns are a common sight in shopping malls, offices, banks, restaurants and schools.
Additional reporting by agencies