It was the first time in 24 years that a Montreal police officer was killed in the line of duty, the city's police chief said.