Kenyans in first al-Shabab battle in Somalia
Kenyan troops have clashed with Islamist militants inside Somalia for the first time since crossing the border nearly two weeks ago.
Kenya army spokesman Maj Emmanuel Chirchir told the BBC a convoy came under attack between the southern towns of Tabda and Bilis Qoqani.
Each side said the other had suffered casualties.
Kenya sent troops into southern Somalia earlier this month, blaming al-Shabab for a spat of kidnappings.
Al-Shabab, which controls much of central and southern Somalia, denies the allegation and has threatened reprisal attacks in Kenya.
Meanwhile, a Kenyan man, who confessed to being a member of al-Shabab, has been sentenced to life in prison after he pleaded guilty to being responsible for Monday's twin grenade attacks in the Kenyan, capital, Nairobi.
The BBC's Noel Mwakugu in court says Elgiva Bwire Oliacha smiled at the cameras and said he had no regrets and would not appeal his sentence.
One person was killed and 29 other wounded in two attacks in the city on a nightclub and bus stop.
A Kenyan army spokesman said Kenyan forces were ambushed about 60km (40 miles) from the border, along the route that leads towards the port of Kismayo - an al-Shabab stronghold.
Residents in the area said the exchange of fire lasted for at least 30 minutes.
Maj Chirchir said nine al-Shabab fighters were killed and two Kenyan soldiers were wounded, one critically.
Al-Shabab disputed the figures, saying 20 Kenyans died and the group's spokesman, Abdul Asis Abu Muscab, told reporters this was just the start of the fighting and more attacks would follow.
Troops from the weak UN-backed interim government in Mogadishu are fighting alongside the Kenyans.
For more than two years, the government has been battling al-Shabab, which is linked to al-Qaeda, and relies on a 9,000-strong Africa Union force for its security in the capital.
Maj Chirchir said the Kenyan army would stick to its mission.
"The main aim is to help the TFG [Transitional Federal Government] attain or achieve freedom of access to the entire of Somalia - that's our aim to diminish al-Shabab," he told the BBC's Network Africa programme.
But BBC Africa analyst Grant Ferret say Kenya's exact aims in Somalia still remain unclear; some suspect it plans to create a buffer zone to provide protection from its unstable neighbour.
The risk is that it not only becomes bogged down in a military campaign against insurgents, but that its own security is undermined, he says.
Last week, the French authorities said a French woman suffering from cancer who was kidnapped from Kenya by Somali gunmen earlier in the month had died.
Other foreigners abducted from Kenya and being held in Somalia include a British woman abducted from a coastal resort, and a Kenyan driver and two Spanish aid workers seized from the Dadaab refugee camp near the Kenya-Somalia border.
Security has been stepped up in Nairobi since Monday's blasts, with many residents fearing there could be more attacks.