The duo was given the option of a KSh 2.3 million fine to evade the imprisonment.
Two detectives have been found guilty of receiving a bribe, concealing evidence, and obstructing Ethics and Anti-Corruption Commission (EACC) officers on lawful duty.
Attached to the Kabete Police Station, Corporal Julius Onyango and Constable Charles Macharia had been attempting to extort KSh 1 million from a Japanese national they had accused of being in the country without proper documentation when the EACC officers busted them.
The duo would then open fire at the anti-graft body detectives in their bid to evade arrest.
The Anti-Corruption Court sitting in Milimani jailed them with options for fines.
Chief Magistrate Thomas Nzioki sentenced Onyango to five years in jail with an option of KSh 1.9 million,
Macharia was handed one year in jail with an option of KSh 400,000.
In other news, officers from the EACC arrested senior lands officials in Kajiado over allegations of demanding a bribe.
Sheila Nandako, the Deputy Land Registrar of Kisamis Lands office in Kajiado West was arrested together with her accomplice, an officer working under her by the name Washington Wahome.
The two are said to have demanded a bribe of Sh148,000 from the complainant to release 74 Title Deeds held by her office without any lawful justification.
"They were processed at Integrity Centre Police Station and later booked at Kilimani Police Station pending further action," EACC said.
The commission said Kajiado Lands Office is among those with many complaints of corruption in land transactions.
In the instant case, the Deputy Land Registrar has allegedly directly and indirectly through the named officer been extorting money from citizens seeking facilitation of land transactions.
"The arrest of the two land officials is part of ongoing operations by the Commission across the country to tame and disrupt corruption at service delivery points where citizens seeking services are routinely subjected to extortion by corrupt public officials," EACC said.
"Notably, corruption at service delivery points hurts ordinary citizens daily and leads to denial or inordinate delay of services."
Members of the public with reports of suspected corruption by any state or public official are encouraged to share the same with EACC for action in accordance with the law.