Since the Vatican was a part of Rome, the practice of the death penalty was spread on it both during the Inquisition, and in the period of its decline. Like everywhere in Italy, the death penalty was executed by secular authorities, and used to be approved by the Holy See since its inception. There are many works of religious leaders, starting with Aurelius Augustine "The City of God" (written in 413-427), that approved of the imposition and execution of death sentences by secular authorities.
The death penalty in the Vatican could not be imposed de facto after the unification of Italy in 1861 and the transition of the capital to Rome in 1870, since the Papal authority wasn't recognized by the newly formed state. The last prisoner was executed for murder on July 9, 1870. All offenses fall under the jurisdiction of Italy, where the death penalty was abolished in 1889.
After resolving the "Roman Question" in 1929, the newly created state of Vatican officially recognized the death penalty for the attempted assassination of the Pope. This rule existed until 1969, when Pope Paul VI ruled out the possibility of applying this punishment, implementing various reforms following the Second Vatican Council. The public learned about it only in 1971, when Pope Paul VI was accused of hypocrisy for openly criticizing Spain and the Soviet Union for their use of the death penalty.
There weren't any attempted assassinations of the Pope during the 40 years of the law on the death penalty in the Vatican. This crime was committed in May 1981 against Pope of John Paul II, who not only removed the death penalty from the Fundamental Law of the Vatican in 2000, but also asked forgiveness for the sins of the Church, including the Inquisition and human rights violations.
A few days after the attack, while in the hospital, Pope John Paul II wrote an appeal to the faithful, in which he said that had forgiven the assailant, Mehmet Ali Agca, and prayed for him. In 1983 John Paul II visited Agca in prison and had a private conversation with him, whose content remains unknown to the public. Subsequently, the pontiff asked the Italian authorities to pardon the offender. In his book "Memory and Identity: Conversations at the Dawn of the Millennium", John Paul II wrote: "Ali Agca, as everyone says, is a professional assassin... This shooting was not his initiative, someone else planned it, someone else hired him."
Mehmet Ali Agca was pardoned by President Ciampi in 2000. After that, he was extradited to Turkey, where the terrorist got a prison term instead of death, to which the Turkish authorities had sentenced him in 1980 for other crimes. While in a Turkish prison, he announced through the media about his conversion to Catholicism. In January 2010, he was released and about 31 years after his private conversation with Paul II he laid a wreath at his tomb in the Vatican.