Both attacks in Lamu county on Kenya's coast close to the border with Somalia, were blamed on the Somali-led Al-Qaeda affiliate that has in recent months focused more attention on Kenya.
A spokesman for the Kenya Defence Forces claimed that 11 Shebab militants were killed, including "two fighters of Caucasian origin".
Two Kenyan soldiers were also killed in the pre-dawn assault on a military camp in Baure, said Colonel David Obonyo.
Obonyo said weapons including 13 AK-47 assault rifles, five rocket-propelled grenades and eight hand grenades were recovered.
Also Read
Chief Yusuf Nuri, a local official, told the Daily Nation newspaper that the gunmen also conducted prayers, ransacked a dispensary and burned mattresses at a primary school before escaping.
Today's raids come on the anniversary of attacks that began in mid-June 2014 in which close to 100 people were killed in a series of armed assaults on the town of Mpeketoni and surrounding villages.
The attacks in Mpeketoni, close to the once-popular holiday island of Lamu, led to a collapse in tourism on Kenya's coast after foreign governments warned their nationals against travel to the area.
In the group's deadliest attack to date four gunmen killed 148 people, mostly students, at a university in Garissa in early April.
In 2013, four Shebab gunmen killed at least 67 people in an assault on the Westgate mall in the capital Nairobi.