Gunmen blocked the bus with their car late on Friday and sprayed it with bullets. They also attacked two lorries carrying mangos near Witu, a town in Lamu County which borders Somalia.
"The attack was in response to Kenya's claim that it deployed more troops in the coast and thus tightened security," Sheikh Abdiasis Abu Musab, spokesman for al-Shabaab's military operations told Reuters.
"Kenya also lied by saying it destroyed al-Shabaab bases there - that is propaganda."
Al-Shabaab has vowed to carry out a campaign of attacks to punish Kenya for sending its troops into Somalia, where Kenyan soldiers are fighting the militants as part of an African Union peacekeeping force.
Gunmen have killed about 100 people on Kenya's coast since mid-June. Al-Shabaab has claimed responsibility for many of the attacks but the government, including President Uhuru Kenyatta, has suggested local politicians were behind the incidents.
(READ MORE: Al-Shabaab not responsible for attacks: Kenyatta)
Kenya Red Cross, which has set up camps for residents who have fled the area, said on its Twitter account that seven people were killed in the attacks.
Miiri Njenga, Lamu County commissioner, said the bus driver and four policemen were killed during Friday's attacks.
"Eight people are receiving treatment at the Mpeketoni hospital and most of them have bullet wounds," Njenga told Reuters, noting that there were unconfirmed reports two more of the passengers on the bus had died.
The frequent attacks near Lamu, an ancient trading port and beach resort, have damaged Kenya's tourism industry and stirred up hostilities in a region where local communities have a history of conflict over land, water and other resources.