Kenya and Britain signed a deal on Wednesday to allow British troops to continue military training in the East African nation for five more years, ending half a decade of protracted negotiations which tested their relations.
For decades British soldiers have prepared for harsh hot-weather warfare on Kenya's arid highlands. About 10,000 soldiers train there every year including, in the past, troops on their way to Iraq and Afghanistan.
Some Kenyan officials have said former colonial master Britain wanted its soldiers to have immunity whilst training in Kenya, something British officials deny.
Britain has also helped train and equip security services in Kenya, where militants from Somali Islamist group al Shabaab have killed hundreds of people over the past few years in gun and grenade attacks.
Western powers view Kenya as a bulwark against the spread of radical Islam out of Somalia, where Kenyan troops form part of an African Union peacekeeping force battling al Shabaab.
"The UK is Kenya’s longest-standing defence and security partner, and both our countries want to see the relationship continue and grow," Britain's ambassador to Kenya, Nic Hailey, said in a statement after signing the agreement.
Under the pact, soldiers who commit crimes when off duty will have to face Kenyan courts while British military tribunals will most likely deal with troops accused of crimes committed when on active duty.
Britain said its military training in Kenya was worth nearly 9 billion shillings ($88.41 million) to the Kenyan economy. Both parliaments still have to ratify the agreement.