It is the result of a clash between two underworld gangs, police say, adding the gunmen had been identified as those belonging to a gang opposed to one of the victims of the incident, M.P. Aruna Damith Udayanga Pathirana alias Samayan.
The CCD is investigating the shooting in which the gunmen had come clad in clothing similar to the police uniform.
The cab they had used has been seized and its registered owner identified.
The dead are Pathirana, four of his followers and two prison officers, while four other officers are being treated at hospital.
The prison department is conducting its own investigation.