The walls surrounding Vatican City are primarily a historical legacy of medieval defense rather than a modern attempt to "keep people out." Most of the current walls were constructed or reinforced during the 9th century by Pope Leo IV after a raid by Saracen pirates in 846 AD. At that time, the Basilica of St. Peter was outside the main city walls of Rome and was vulnerable to attack. These "Leonine Walls" were built to protect the sacred sites and the residents of the Vatican Hill. Over the subsequent centuries, various Popes expanded and fortified the walls for both defensive purposes and to define the administrative boundaries of the papal residence. Today, the walls serve as the official international border between Italy and the sovereign State of Vatican City, as established by the Lateran Treaty of 1929. While the walls look imposing, they are largely symbolic in the modern era; the main entrance via St. Peter's Square is completely open to the public, and the walls are primarily maintained as a historical monument and a marker of the Vatican's status as the world's smallest independent city-state.