NAIROBI, Kenya — Kenyan police officials say three police officers were killed and seven others wounded as gunmen suspected to be al-Shabab militants attacked Pandaguo center, Lamu County.

Two officials, who insisted on anonymity because they are not authorized to speak with the press, said Wednesday it took a seven-hour gun battle for the military and police to retake the village center. Police spokesman George Kinoti confirmed the death toll.

Officials said about 100 militants attacked the village and burned the local police post, a primary school and a dispensary. Al-Shabab has vowed revenge for Kenya’s 2011 deployment of troops to Somalia to fight the group. Al-Shabab has carried out more than 100 attacks in Kenya.