Police say Abdirsheed Abdunur, the town’s intelligence chief, was killed in a blast claimed by al-Shabaab.
Police said a bomb exploded outside the central Somalia town of Dhumashrib on the roadside, with 12 agents of the National Intelligence and Security Agency working on it.
Police officer Mohammed Ahmed said that those killed included Abdirsheed Abdunur, the head of the intelligence agency in Dhusramirib.
Al-Qaeda-linked armed group, al-Shabaab claimed responsibility for the attack.
Political leaders have met in Dhusamireb, a town about 510 kilometers (317 mi) north of the capital Mogadishu, to try to resolve a dispute over the election to be held on Monday.
A deal about electing a new president on Monday has become elusive, threatening to bring more political turmoil.
Somalia initially aimed to hold its first direct election in more than 30 years, but the delay in preparation, and the government’s inability to rein in daily attacks by al-Shabaab, meant switching to an indirect vote, With legislators electing elders who will elect a president. .
However, regional authorities in at least two of Somalia’s five federal states, Puntland and Jubland, opposed holding elections for now.