In Greek mythology, the sea god Poseidon, lost in his fury, decided to sink the earth, and he sent the Cetus monster to ravage the city. To calm him down, the people decided to chain Andromeda to a rock and offered her as a sacrifice to the god and the monster.
When everything was lost to her, the hero Perseus rescued her, using the Medusa's head to petrify the Cetus monster into stone.