Seventeen detainees escaped from a prison in Bahrain, police said on Saturday, and the government warned citizens against giving them shelter.