NAIROBI, Kenya — The attackers burst into the Kenyan military base inSomalia before dawn, blasting through the gate with a truckload of explosives.
Scores of Shabab militants then flooded through the flames, on foot and in trucks, firing heavy guns into the plastic-covered shelters where the Kenyan soldiers were sleeping.
“That battle was over before it started,” said one official in Nairobi with detailed knowledge of the attack. “The Shabab did their homework and completely wiped them out.”
Somali and Western officials now say that 80 to 100 Kenyan soldiers — and possibly more — were massacred during the attack, which took place on Friday at the El-Adde forward operating base. The Shabab overran the base, held it for several hours and made off with sensitive communications equipment, artillery pieces that can fire 10 miles and several American-made armored Humvees.
But since then, Kenya’s leaders have refused to disclose the number of dead or other details, trying to soften the blow of what may be the worst military disaster in this country’s history.
“This has been a shock,” said Yusuf Hassan, a member of Kenya’s Parliament. “We’re not Burundi, we’re not Ethiopia, we’re not Uganda. Our country does not have a history of war. We’ve never experienced anything like this.”
The attack could mark a turning point for the Shabab, one of Africa’s most violent militant groups. In recent years, the Shabab have lost much of their territory, reduced to small bands of famished fighters creeping aroundSomalia’s rural areas and attacking soft targets in Kenya, including a university and a mall.
Now, it seems, they are training their sights on the hardest targets out there — military bases. In the past months, Shabab fighters have staged assaults against Ethiopian, Ugandan and Burundian troops, all members of a relatively loosely organized African Union peacekeeping mission in Somalia. They have killed scores of soldiers and stolen their arsenals. Their propaganda videos show alarming amounts of guns, vehicles and overflowing buckets of bullets now in their hands.
“This is going to end no time soon,” said David M. Anderson, a professor of African history at the University of Warwick and a renown expert on modern Kenya.
The Shabab may be hatching a renewed bid to take over Somalia, which remains in varying degrees of turmoil, depending on the area, with the national government widely reviled as corrupt and weak, and small, clan-based city-states popping up across the country.
Or something else may be driving the Shabab’s hunger for weapons, something the West is particularly worried about.
In recent months, the Islamic State has planted its black flag in Somalia’s soil. The group is drawing a small trickle of disgruntled Shabab defectors who believe that the Shabab should ditch its longstanding relationship withAl Qaeda and join the world’s leading brand of militant Islam.
Already, Shabab and Islamic State fighters have clashed in northern and central Somalia, raising fears that some areas of Somalia could slide into an intra-Islamist free-for-all, like in Syria.
“The Shabab are now mimicking the Islamic State,” said Rashid Abdi, a senior analyst at the International Crisis Group, which studies conflicts worldwide. “They are trying to regain public support by saying: ‘We’re not just chickens who go for soft targets. We’re men who go after military bases.”’
The Kenyan public is steadily losing its appetite for the Somali military operation. Kenya sent troops across the border in 2011, saying it needed to create a buffer zone to protect tourism and other aspects of the economy. It did not quite work out that way. The Kenyan Army’s incursion simply brought the Shabab deeper into Kenya, setting off a string of increasingly devastating suicide missions that have killed hundreds of civilians and hurt the economy, especially the tourism industry. Kenyan soldiers have also been accused of smuggling sugar, as well as other illegal activities inside Somalia.
Kenya has fought skirmishes with Somali bandits along its borders for years, but it has never lost a hundred soldiers in one battle, officials and analysts say. In past months, opposition politicians urged the government to rethink its Somalia strategy. Now even members of the governing coalition, like Mr. Hassan, are beginning to call for an orderly withdrawal.
“We should spend another year or two training as many Somalis as we can and then get out,” he said.
Boniface Mwangi, one of Kenya’s leading artist-activists, said he was extremely frustrated that the government has refused to disclose any casualty figures. “Why is the government hiding the truth?” he asked.
Mr. Mwangi also criticized President Uhuru Kenyatta for attending political rallies in the Mombasa area this past week. “It’s a national shame that our president is busy politicking while the dead bodies are coming home,” he said.
Mr. Kenyatta has summoned security chiefs, ordered airstrikes and delivered a televised address, saying on Tuesday, “We are well aware peace and security have their price.”
According to several analysts, the Kenyans at the El-Adde base, located about 50 miles from the Kenyan border, were extremely vulnerable. They were in hostile territory, surrounded by members of a clan deeply opposed to Kenya’s military presence. Somali officials said the company of Kenyan soldiers, estimated to be about 150, had been there only two weeks, with few local sources of information.
Several analysts said the Kenyans had ventured out of their comfort zone along the coast, where the bulk of Kenyan troops are based, pushing deeper into the Somali hinterland because Ethiopia was preparing its own offensive. Though the two nations are allies on paper, Kenya and Ethiopia often do not coordinate their military operations and they have backed different factions of Somalis in a covert contest for influence.
There have been reports that small bands of Kenyan soldiers fled into the desert and survived the attack, but so far only four from the El-Adde base — all of them wounded — have made it back to Nairobi, Kenya’s capital. The rest are dead, missing or captured.
“I have a wife and two children back home,” said one Kenyan prisoner of war in a recording that the Shabab released. “On 15 January, 2016, the camp was raided by the Al Shabab, whereby they overpowered us.”
Before the recording cut out, the soldier said: “Most of our friends were killed.”