Al-Shabab Islamist militants attacked Taa village in the Pandaguo area of Lamu county on Christmas Day - a Christian religious holiday - and killed two local men.
The area neighbours Boni forest, where security agencies have been conducting an operation since 2015 to flush out militants in hiding.
The forest near the Kenya-Somalia border and the area around it have been repeatedly attacked by the militant group in recent years.
Police said the attackers invaded the village, some miles away from the popular tourist destination of Lamu town, and targeted homes in a coordinated manner.
Many villagers ran and hid in bushes as the gang descended on their homes, survivors said.
Coast regional commissioner John Elungata said assailants attacked the village at night but were repulsed by Kenya Police Reservists after a heavy gunfight.
Elungata urged locals to cooperate with security officers on the ground.
“The situation is calm, we have officers patrolling the area and we would like to ask members of the public to tell us what they know to help us in our investigations as we continue hunting them,” he said.
The attack comes barely a week after the suspected al-Shabab militants attacked a police vehicle in northern Kenya, killing two officers and a civilian.
Kenya began the construction of a 700-kilometre-long wall along its border with Somalia in 2015 to stop al-Shabab militants from crossing in and out of Kenya.
The project includes having designated immigration and customs entry points with a concrete wall fitted with CCTV cameras.
Trenches are also being constructed in the area.
The plan includes the creation of at least 22 border posts with well-equipped personnel to respond to any form of aggression.
Officials say, once complete, the teams will be spread 40 kilometres apart to enable quick response to attacks from militants.
The fence, especially in Mandera and Lamu, has helped reduce incidents of attacks by the militants who previously crossed at will.
Research by government security agencies says about a third of the country’s security problems are traced to the porous Somalia border.
Chad's interim president pardons 380 rebels jailed for 2021 death of former president
Kenyan police on high alert as they brace for more anti-government protests
Ethiopia appoints rebel leader to head regional government
Go to video
Kenyans cry foul over economic crisis
Ethiopia's parliament removes Tigray rebel party from terror list
Go to video
Kenya: 83% increase in tourism revenues in 2022