The deceased has been identified as Sabu Mathew, deputy commandant at A R Camp in Thripunithura.
The incident occurred when he was in a police jeep along with his driver and another police official around 2 AM, they said.
He was rushed to a private hospital in the city with gun shot injuries, police said.
"The official, who suffered the gunshot wound, has passed away due to his injuries," a police officer said.
The officer was on night patrol duty in the Vazhakkala area of the city, police said.