Castagna studied in universities all across Italy and obtained a doctorate in civil law and canon law when he finished his studies at the University of Bologna.
His twelve-day papacy was the shortest in history. He was of Genoese origin, although born in Rome. He served as a constitutional lawyer and entered the Roman Curia during the pontificate of Pope Julius III as the Referendary of the Apostolic Signatura.
Castagna was chosen to be the new Archbishop of Rossano on 1 March 1553, and he would quickly receive all the minor and major orders culminating in his ordination to the priesthood on 30 March 1553 in Rome.
He then received episcopal consecration a month after at the home of Cardinal Girolamo Veralli. He served as the Governor of Fano from 1555 to 1559 and later served as the Governor of Perugia and Umbria from 1559 to 1560.
Castagna would later participate in the Council of Trent from 1562 to 1563 and served as the president of several conciliar congregations. He was appointed as the Apostolic Nuncio to Spain in 1565 and served there until 1572, resigning his post from his archdiocese a year later.
He also served as the Governor of Bologna from 1576 to 1577.
Among other positions, he was the Apostolic Nuncio to Venice from 1573 to 1577 and served also as the Papal Legate to Flanders and Cologne from 1578 to 1580. Pope Gregory XIII elevated him to the cardinalate on 12 December 1583 and he was appointed as the Cardinal-Priest of San Marcello. Election
After the death of Pope Sixtus V a conclave was convoked to elect a successor.
Castagna was elected as pope on 15 September 1590 and his election was brought about due to the backing of the Spanish factions.
He selected the pontifical name of "Urban VII". Activities
Urban VII"s short passage in office gave rise to the world"s first known public smoking ban, as he threatened to excommunicate anyone who "took tobacco in the porchway of or inside a church, whether it be by chewing it, smoking it with a pipe or sniffing it in powdered form through the nose".
Urban VII was known for his charity to the poor. He also subsidized public works projects throughout the Papal States.
Urban VII was strictly against nepotism and he forbade it within the Roman Curia.
Urban VII died on 27 September 1590, shortly before midnight, of malaria in Rome. He was buried in the Vatican. The funeral oration was delivered by Pompeo Ugonio.
His remains were later transferred to the church of South. Maria sopra Minerva on 21 September 1606.
His estate was valued at 30,000 scudi and it was bequeathed to the Archconfraternity of the Annunciation to use as dowries for poor young girls.
He subsidized Roman bakers so they could sell bread under cost, and restricted the spending on luxury items for members of his court.