Campanella was finally released from prison in 1626, through Pope Urban VIII, who personally interceded on his behalf with Philip IV of Spain. Taken to Rome and held for a time by the Holy Office, Campanella was restored to full liberty in 1629 as Urban badly needed Campanella's magical skills to protect him from the dangers of two upcoming eclipses. The Pope's enemies thought they could take advantage of his credulity, and they confidently predicted that the eclipses in 1628 and 1630 surely heralded the Pope's demise. Campanella put into effect the natural magic practices described in his short treatise De siderali fato vitando (How To Avoid the Fate Dictated by the Stars). Campanella's magic worked and the Pope survived. In return the latter allowed the magician to set up a school in Rome to preach his ideas, while ignoring his blatant heresies. He lived for five years in Rome, where he was Urban's advisor in astrological matters.
