At least 25 inmates and two security officers have been killed in a riot at a high-security prison in the northern Tajik city of Khujand, security sources said on Thursday.