Filippo Guastavillani was born in Bologna September 28, 1541, the son of Bolognese patricians Angelo Michele Guastavillani and Giacoma Boncompagni. His mother was the sister of Pope Gregory XIII. He was the cousin of Cardinal Filippo Boncompagni.
His uncle Pope Gregory XIII made him a cardinal deacon in the consistory of July 5, 1574. He received the red hat and the deaconry of Santa Maria Nova on July 14, 1574. On November 8, 1577, he opted for the deaconry of Santa Maria in Cosmedin. He became the Governor of Spoleto in 1578, and served as the Governor of Ancona from October 18, 1578 to 1585. He served as cardinal protector of Loreto Cathedral from December 11, 1580 until his death. On December 19, 1583, he opted for the deaconry of Sant'Angelo in Pescheria.
He participated in the papal conclave of 1585 that elected Pope Sixtus V. The new pope named him Governor of Montis Castelli Tudertini in 1585. On January 7, 1587, Cardinal Guastavillani opted for the deaconry of Sant'Eustachio. He was the Camerlengo of the Holy Roman Church from May 14, 1584 until his death. He was also Governor of Bologna and Ferrara.