Europe, including the Italian peninsula, was in the midst of considerable political ferment when the bishop of Imola, Cardinal Giovanni Maria Mastai-Ferretti, was elected pope. He took the name Pius, after his generous patron and the long-suffering prisoner of Napoleon, Pius VII. He had been elected by the faction of cardinals sympathetic to the political liberalization coursing across Europe, and his initial governance of the Papal States gives evidence of his own moderate sympathies; under his direction various sorts of political prisoners in the Papal States were released. A series of terrorist acts sponsored by Italian liberals and nationalists, which included the assassination of (among others) his Minister of the Interior, Pellegrino Rossi, and which forced him briefly to flee Rome in 1848, along with widespread revolutions in Europe, led to his growing skepticism towards the liberal, nationalist agenda. Through the 1850s and 1860s, Italian nationalists made military gains against the Papal States, which culminated in the seizure of the city of Rome in 1870 and the dissolution of the Papal States. Thereafter, Pius IX refused to accept the Law of Guarantees from the Italian government, which would have made the Holy See dependent on legislation that the Italian parliament could modify at any time. Pius refused to leave Vatican City, and was thereafter referred to (chiefly by himself) as the "Prisoner of the Vatican". His ecclesiastical policies towards other countries, such as Russia, Germany or France, were not always successful, owing in part to changing secular institutions and internal developments within these countries. However, concordats were concluded with numerous states, such as Austria-Hungary, Portugal, Spain, Canada, Tuscany, Ecuador, Venezuela, Honduras, El Salvador, and Haiti.
Pius was a Marian pope, who in his encyclical Ubi primum emphasized Mary's role in salvation. In 1854, he promulgated the dogma of the Immaculate Conception, articulating a long-held Catholic belief that Mary, the Mother of God, was conceived without original sin. He conferred the title Our Mother of Perpetual Help on a famous Byzantine icon from Crete entrusted to the Redemptorists. In 1862, he convened 300 bishops to the Vatican for the canonization of Twenty-six Martyrs of Japan. His 1864 Syllabus of Errors stands as a strong condemnation against liberalism, modernism, moral relativism, secularization, and separation of church and state, in effect definitively restating Catholic teaching regarding state recognition of the Catholic faith as the state religion as imperative in nations where the majority of the population is Catholic. However, his most important legacy is the First Vatican Council, which convened in 1869, which defined the dogma of papal infallibility, but was interrupted as Italian nationalist troops threatened Rome. The council is considered to have contributed to a centralization of the church in the Vatican, while also clearly defining the Pope's doctrinal authority.
Many contemporary ecclesiastical historians and journalists question his approaches. His appeal for public worldwide support of the Holy See after he became "the prisoner of the Vatican" resulted in the revival and spread to the whole Catholic Church of Peter's Pence, which is used today to enable the Pope "to respond to those who are suffering as a result of war, oppression, natural disaster, and disease". After his death in 1878, his canonization process was opened on 11 February 1907 by Pope Pius X, and it drew considerable controversy over the years. It was closed on several occasions during the pontificates of Pope Benedict XV and Pope Pius XI. Pope Pius XII re-opened the cause on 7 December 1954, and Pope John Paul II proclaimed him Venerable on 6 July 1985. He was beatified on 3 September 2000 after the recognition of a miracle. Pius IX was assigned the liturgical feast day of 7 February, the date of his death.
Giovanni Maria Mastai-Ferretti was born on 13 May 1792. He was the ninth child born in Senigallia into the noble family of Girolamo dei conti Ferretti, and was baptized on the same day of his birth with the name of Giovanni Maria Giambattista Pietro Pellegrino Isidoro. He was educated at the Piarist College in Volterra and in Rome. As a young man in the Guardia Nobile the young Count Mastai was engaged to be married to an Irishwoman, Miss Foster (the daughter of the Bishop of Kilmore), and arrangements were made for the wedding to take place in the Church of San Luigi dei Francesi. Mastai’s parents opposed the marriage and, in the event, he did not appear at the church on the appointed day.
As a theology student in his hometown Sinigaglia, in 1814 he met Pope Pius VII, who had returned from French captivity. In 1815, he entered the Papal Noble Guard but was soon dismissed after an epileptic seizure. He threw himself at the feet of Pius VII, who elevated him and supported his continued theological studies.
The pope originally insisted that another priest should assist Mastai during Holy Mass, a stipulation that was later rescinded, after the seizure attacks became less frequent. Mastai was ordained a priest on 10 April 1819. He initially worked as the rector of the Tata Giovanni Institute in Rome. Shortly before his death, Pius VII sent him as Auditor to Chile and Peru in 1823 and 1825 to assist the Apostolic Nuncio, Monsignore Giovanni Muzi and Monsignore Bradley Kane, in the first mission to post-revolutionary South America. The mission had the objective to map out the role of the Catholic Church in the newly independent South American republics. He was thus the first pope ever to have been in America. When he returned to Rome, the successor of Pius VII, Pope Leo XII appointed him head of the hospital of San Michele in Rome (1825–1827) and canon of Santa Maria in Via Lata.
Pope Leo XII appointed Mastai-Ferretti Archbishop of Spoleto in 1827 at the age of 35 years. In 1831, the abortive revolution that had begun in Parma and Modena spread to Spoleto; the Archbishop obtained a general pardon after it was suppressed, gaining him a reputation for being liberal. During an earthquake, he made a reputation as an efficient organizer of relief and great charity. The following year he was moved to the more prestigious diocese of Imola, was made a cardinal in pectore in 1839, and in 1840 was publicly announced as Cardinal-Priest of Santi Marcellino e Pietro. As in Spoleto, his episcopal priorities were the formation of priests through improved education and charities. He became known for visiting prisoners in jail, and for programs for street children. Cardinal Mastai-Ferretti was considered a liberal during his episcopate in Spoleto and Imola because he supported administrative changes in the Papal States and sympathized with the nationalist movement in Italy.