The bus was travelling to Nairobi when it was stopped in Mandera county, not far from the Somali border.
The Somali gunmen separated out non-Muslims by asking passengers to read from the Koran, officials and witnesses said. Those who failed were then shot in the head.
Al-Shabab has carried out a series of attacks in Kenya since 2011.
A statement on a website linked to the Islamist group carried a statement saying the attack was carried out in retaliation for security raids on mosques in the coastal city of Mombasa earlier this week.
Kenyan interior ministry said on its Twitter feed that a camp belonging to the attackers had been destroyed by Kenyan military helicopters and jets, with “many killed”.
More than 60 passengers were on the bus when it was attacked, before dawn on November 22, about 19 miles from Mandera town.
The driver tried to accelerate away, but the vehicle became stuck in mud caused by recent heavy rains.
About 10 heavily armed men talking Somali ordered the passengers off the bus.
Kenya’s Red Cross said emergency workers were trying to retrieve bodies from the scene.
Security agencies were “in pursuit of the criminal gang” that carried out the attack, the interior ministry said. It described the assailants as “bandits”.
A local official quoted by Kenyan media said the government had failed to answer their pleas for extra security.
The attack comes after a week of heightened tension in Mombasa, which has suffered a series of al-Shabab attacks.
Security forces raided mosques in the city, saying they were being used to store weapons. The raids triggered apparent revenge attacks by Muslim youths.
Kenya has experience a series of al-Shabab attacks since it sent troops to Somalia three years ago to help fight the militant group.
Mandera, a remote area in Kenya’s north-east that shares a long and porous border with Somalia, has been one of the regions worst-affected by the violence.
On the Somali side of the border, al-Shabab is said to have a base that was recently bombed by Kenyan warplanes. It was not immediately clear whether this was the same base targeted by Kenya following Saturday’s attack.
dy4QeQb7KYcThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…