Several Kenya Defence Forces (KDF) officers were killed after Al-Shabaab militants stormed an African Union base in El Adde, Somalia on Friday, resulting in a fierce fight.
President Uhuru Kenyatta who confirmed the deaths did not indicate how many Kenyan soldiers died.
The Defence ministry had on Friday morning said the 4am attack was on the Somali National Army (SNA) camp which is close to the KDF site, near Kenya and Ethiopia borders, prompting them to counter-attack in support of SNA.
"Our gallant soldiers reacted swiftly to protect their camp; to protect their peace and stability that they are in Somalia to secure; and to protect our country from its enemies and their sympathisers," Mr Kenyatta said.
"Regrettably, some of our patriots in uniform paid the ultimate price. It is heart-breaking."
The Islamist group claims to have taken "complete control" of the AU camp and killed more than 60 Kenyan soldiers. Kenya is yet to reveal the number of casualties.
President Kenyatta said Kenya will not be cowed and that KDF will remain in Somalia to complete its mission of eliminating the militant group.
"We will hunt down the criminals involved in today's events. Our soldiers' blood will not be shed in vain," he said.
According to Reuters, the Al Shabaab said it captured armoured vehicles and was in control of a small town of Ceel Caddo. The militants say the attacks are retaliation for the Kenyan military presence in Somalia.
Kenya deployed its troops in 2011 following sustained attacks at its Coast and kidnapping of foreigners by the militants, which was beginning to take a toll its tourism.