The idea of something malevolent that is trapped in something, has been around for a while.
Perhaps another variation of this myth is in a movie called, The-Keep.
Its energy is transformed into a monstrous shapes. Eventually, the monster is put back into confinement.