apparently it was the custom of the ancients during great crisis for the ruler of a city or nation to avert common ruin by sacrificing the most beloved of their children to the avenging demons ; and those who are thus given up are sacrificed with mystic rites , arrayed in royal apparel and sacrificed on an altar .