Al-Shabaab fighters are seen outside a building in the Dayniile district of southern Mogadishu, Somalia. File picture: Feisal Omar

Nairobi - The Kenyan army has rescued two aid workers held in captivity in Somalia by the radical Islamist group al Shabaab for nearly three years, a military spokesman said Friday.

Major Emmanuel Chirchir said the two Kenyans, who were rescued on Thursday, were undergoing medical tests before being airlifted to Kenya. Daniel Njuguna

Wanyoike - a truck driver's assistant reportedly working for a company subcontracted by Medecins Sans Frontieres - and James Kiarie Gichuhi - a driver for Care International - were kidnapped in October and November 2011 respectively.

Wanyoike was captured on a road to the port of Kismayu; Gichuhi in a refugee camp near the Kenyan border. The Kenyan army reported on Twitter the two were freed by Kenyan troops cooperating with the African Union mission in Somalia.

Kenya and the AU are backing the Somali government in its fight against al-Shabaab. Kenyan military spokesman Willy Wesonga said he could not reveal the number of Kenyans still in al Shabaab captivity.

However, the army was gathering information based on claims made by the group and would act on that basis, Wesonga told dpa.

The rescue of the aid workers coincided with a major security operation in Kenya targeting Somali refugees following a string of grenade attacks.

Thousands of Somalis have been detained and are being held at a Nairobi football stadium, according to news reports. Interior Minister Joseph Ole Lenku said 82 of those arrested were deported this week, while 400 more were being screened.