Witnesses in Mpeketoni said gun battles lasted for several hours and reported seeing buildings set on fire.
The town is on the mainland near Lamu island, a well-known tourist resort.
Kenya has suffered numerous militant attacks since 2011 when its forces entered neighboring Somalia to combat the al-Qaeda-linked al-Shabab group.
This is the most deadly attack in Kenya since at least 67 people were killed during a siege by al-Shabab fighters at Nairobi’s Westgate shopping centre last September.
Kenyan army spokesman Major Emmanuel Chirchir said the attackers were “likely to be al-Shabab”, but the group has not yet commented.
Other unconfirmed reports said the raid was linked to a land dispute between rival communities in the remote area.
Interior Minister Joseph Ole Lenku described the attackers as bandits, and said they had crossed a “red line”.
“I want to assure Kenyans that the perpetrators of this heinous act will be pursued to face the full force of the law,” he said at a news conference.
Police fought fierce battles with the gunmen, who fled into a nearby forest, Joseph Ole Lenku said.
President Uhuru Kenyatta earlier summoned Joseph Ole Lenku and police chief David Kimaiyo to discuss the security situation.
The attack started at 20:30 local time on Sunday as locals were watching a football World Cup match on television.
All those killed are believed to be locals. The Kenya Tourism Board (KTB) says no foreigners were in the town at the time of the attack.
Witnesses said gunmen, who had their faces covered, threw explosives into the local police station before entering and stealing weapons.
Kenya has been on high alert recently following warnings that al-Shabab was planning more attacks.
nCoe6uEcBHgImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…