A Roman and the son of Radoald, was unanimously elected to succeed Sergius II, and as the alarming attack of the Saracens on Rome in 846 caused the people to fear for the safety of the city, he was consecrated (10 April, 847) without the consent of the emperor. … As soon as Leo, much against his will, became pope, he began to take precautions against a repetition of the Saracen [Muslim] raid of 846. 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. 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 852 the fortifications were completed, and were blessed by the pope with great solemnity.
Whilst the work of refortifying the city was in progress, a great fleet of the Saracens sailed for Rome, seemingly from Sardinia, but it was completely destroyed off Ostia by the allied fleets of Rome, Naples, Amalfi, and Gaeta, and by a tempest (849). When the rebuilding of the walls of Rome was accomplished, Leo rebuilt Portus, and handed it over to a number of Corsican exiles, whom the ravages of the Saracens had driven from their homes. Other cities too in the Roman duchy were fortified, either by the pope himself or in consequence of his exhortations.
Leo also endeavoured to make good the damage which the Saracen raid of 846 had done to the different churches. St. Peter’s had suffered very severely, and though as a whole it never again reached its former magnificence, Leo managed to make it in parts at least more beautiful than it had been before. St. Martin’s, where he had been educated, the Quatuor Coronati, of which he had been the priest, the Lateran Palace, the Anglo-Saxon Borgo, Subiaco, and many other places both in Rome and out of it were renovated by the energetic Leo.