What is now called the Vision of Pope Leo XII took place on October 13, 1884.
It was after this that he composed the prayer to St. Michael.
This came about as a result of His Holiness having been given a vision of one hundred years of Satan’s having been given rein over the earth.
He was so shaken by his vision that he reportedly passed out, and some thought he had had a stroke or heart attack, until he explained what had happened.
Some legends say that the Pope had a locution in which he heard God and Satan conversing.
The gist of the conversation was that Satan told God he could destroy the church, at which the Lord told him to go ahead.
Satan replied that he needed more time and more power.
The Lord asked how much time and how much power.
Satan answered that he needed 100 years and greater power of the people of the earth.
According to the legends, God gave Satan the time (20th century) and the power.
Pope Leo XIII composed the prayer to St. Michael the Archangel, asking his protection. It goes as follows:
"Saint Michael the Archangel, defend us in the battle; be our defense against the wickedness and snares of the devil. May God rebuke him and do you, O Prince of the Heavenly Host, by the power of God, thrust into hell Satan and the other evil spirits who prowl about the world seeking the ruin of souls. Amen"