Pope Leo IV (790 – 17 July 855) was the bishop of Rome and ruler of the Papal States from 10 April 847 to his death. He is remembered for repairing Roman churches that had been damaged during the Arab raid against Rome, and for building the Leonine Wall around Vatican Hill to protect the city. Pope Leo organized a league of Italian cities who fought and won the sea Battle of Ostia against the Saracens.
 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 Santi Quattro 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 during the Arab raid against Rome. He restored and embellished the damaged Basilica of Saint Paul Outside the Walls and St. Peter's Basilica. 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, Leo IV summoned the maritime republics – 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 league destroyed the Saracen fleet 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. 
 Raphael's The Fire in the Borgo celebrates the incident in which, according to legend, Leo stopped a fire in the pilgrims' district by making the sign of the cross.
 Leo IV held three synods, the one in 850 distinguished by the presence of Emperor Louis II, but the other two of little importance. In 853, he travelled to Ravenna to settle a dispute with the archbishop. As the archbishop was on 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. 
 Before his death in 855 the Pope welcomed Aethelwulf King of Wessex and his sons, including the seven year old Alfred the Great, who at 5 had already met him in 853, as pilgrims to Rome.
 Leo IV died on 17 July 855 and was succeeded by Benedict III, although a legend says he was succeeded by Pope Joan for two years. Nowadays, the story of Pope Joan is regarded by scholars as fictional.
 Leo IV was originally buried in his own monument in St. Peter's Basilica. Some years after his death, his remains were put into a tomb that contained the first four popes named Leo. In the 18th century, the relics of Leo the Great were separated from his namesakes 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.