After Pope Gregory XI's death, Urban VI became pope in Rome. Officials said he was invalid. French cardinals elected Pope Clement VII in 1378, who moved to Avignon. Urban stayed in Rome. Bishops meet in 1409, and elected one pope to replace Urban and Clement, who both refused to step down, resulting in three popes. In 1417, Pope Martin V was elected to replace them. The motion succeeded, and Martin moved the papacy back to Rome.