John Paul was elected pope in October 1978 and died April 2005. The longest papacy was that of Pope Pius IX, who was pope for 32 years (1846-1878)