School teacher Judy Mutua, a Kenyan national, was abducted on Monday in the world’s largest refugee settlement, Dadaab in northeast Kenya.
The Somali-led and Al-Qaeda-linked Shabaab insurgents took the teacher some 15 kilometres (10 miles) into Somalia, but Kenyan and Somali government forces attacked the gunmen on Friday morning, killing one kidnapper and arresting another.
Kenyan army spokesman David Obonyo said Mutua was freed in a “well coordinated operation” and that the teacher was safe.
“Ms Mutua is currently receiving treatment at a secure location and will be airlifted by the Kenya Air Force to Nairobi,” Obonyo said in a statement.
Kenyan troops have been fighting Shabaab insurgents inside southern Somalia since the army invaded in 2011, later joining the African Union force battling the Islamists.
The Shabaab have launched a string of revenge attacks in Kenya, including their biggest attack to date earlier this year – the massacre of 148 people, most of them students, at Garissa University in the northeast.
Some 350,000 Somali refugees live in the Dadaab refugee camps 80 kilometres (50 miles) inside Kenya from the border. They have come to Kenya in waves since 1991, propelled by civil war and famine.