A Roman by birth, Leo received his early education at Rome in the monastery of St. Martin, near St. Peter's. He attracted the notice of Pope Gregory IV, who made him a subdeacon; and was created Cardinal-Priest of the church of the Quatuor Coronati by Pope Sergius II.
In April 847, Leo was unanimously chosen to succeed Sergius II. As the attack of the Saracens on Rome in 846 caused the people to fear for the safety of the city, he was consecrated on 10 April, 847 without waiting for the consent of the emperor.
He immediately began to repair the damage done to various churches of the city by the Saracens during the reign of his predecessor. He restored and embellished the damaged Basilica di San Paolo fuori le Mura and St. Peter's. The latter's altar again received its gold covering (after being stolen), which weighed 206 lb. and was studded with precious gems. Following the restoration of St. Peter's, Leo appealed to the Christian kingdoms to confront the Arab raiders.
Leo also took precautions against further raids. He put the walls of the city into a thorough state of repair, entirely rebuilding fifteen of the great towers. He was the first to enclose the Vatican hill by a wall. Leo ordered a new line of walls encompassing the suburb on the right bank of the Tiber to be built, including St. Peter's Basilica, which had been undefended until this time. The district enclosed by the walls is still known as the Leonine City, and corresponds to the later rione of Borgo. To do this, he received money from the emperor, and help from all the cities and agricultural colonies (domus cultae) of the Duchy of Rome. The work took him four years to accomplish, and the newly fortified portion was called the Leonine City, after him.
In 849, when a Saracen fleet from Sardinia approached Portus, the Pope summoned the Repubbliche Marinare (or mariner cities of Italy) – Naples, Gaeta and Amalfi – to form a league. The command of the unified fleet was given to Cesarius, son of Duke Sergius I of Naples. Aided by a fierce storm, the Saracen fleet was destroyed off Ostia. The Battle of Ostia was one of the most famous in history of the Papacy of the Middle Ages and is celebrated in a famous fresco by Raphael and his pupils in his rooms of the Vatican Palace in the Vatican City.
A separate incident in Leo's life celebrated by the Urbinate in his series of frescoes for the Incendio di Borgo is the fire in the pilgrims' district of Rome (the "Borgo"), which, according to legend, was stopped by Leo making the sign of the cross.
Leo IV held three synods, the one in 850 distinguished by the presence of Holy Roman Emperor Louis II, but the other two of little importance. In 863, he travelled to Ravenna to settle a dispute with the archbishop. As the archbishop was a good terms with Emperor Lothair I, the pope had little success. The history of the papal struggle with Hincmar of Reims, which began during Leo's pontificate, belongs properly to that of Nicholas I.
Leo IV died on 17 July 855 and succeeded by Benedict III.
Leo IV was originally buried in his own monument in St. Peter's Basilica, however some years after his death, his remains were put into a tomb that contained the first four Pope Leos. In the 18th century, the relics of Leo the Great were separated from the other Leos and given their own chapel.
Leo IV had the figure of a rooster placed on the Old St. Peter's Basilica or old Constantinian basilica which has served as a religious icon and reminder of Peter's denial of Christ since that time, with some churches still having the cockerel on the steeple today. It is reputed that Pope Gregory I had previously said that the cock (rooster) "was the most suitable emblem of Christianity", being "the emblem of St Peter". After Leo IV, Pope Nicholas I, who had been made a deacon by Leo IV, decreed that the figure of the cock (rooster) should be placed on every church.