"President John Pombe Magufuli is surprised and very sorry to learn of the news of the death of eight police officers killed last night by armed people," Tanzania's presidency said in a statement.
The policemen came under attack in their vehicle in the eastern region of Kibiti as they returned from patrol, and their assailants fled into a nearby forest, the statement said.
The officers were part of a unit deployed to pacify the region south of Tanzania's largest city Dar Es Salaam.
Local authorities say nine officials belonging to Magufuli's ruling Chama cha Mapinduzi (CCM) have been killed in the coastal districts of Kibiti and Rufiji since last October.
A separate attack killed three police officers in the area last month.
The killings, and uncertainty over the motive, has spread fear throughout local government in the region.
While the assailants have not been identified, they typically use motorcycle taxis to escape after assassinations and steal weapons from police officers' bodies.
Magufuli condemned the violence, calling in the statement for "cooperation of all Tanzanians to stop these acts."
A former minister of works who campaigned on an anti-corruption platform, Magafuli won election in East Africa's most populous country in 2015.