The low-ranking policeman shot dead the detainee in April inside a Cairo police station.
They had a history of disputes and had fought before the policeman, Ahmed al-Tayyib, detained him over an outstanding warrant last April, hours before he shot him dead, according to court evidence.
The sentence by the Cairo court can be appealed.
It was among the harshest in years against a policemen, with dozens in particular acquitted of charges of violence or brutality against protesters.