Avignon first gained its ramparts – and reputation for arts and culture – during the 14th century, when Pope Clement V fled political turmoil in Rome. From 1309 to 1377, seven French-born popes invested huge sums in the papal palace and offered asylum to Jews and political dissidents. Pope Gregory XI left Avignon in 1376, but his death two years later led to the Great Schism (1378–1417), during which rival popes (up to three at one time) resided at Rome and Avignon, denouncing and excommunicating one another. Even after the matter was settled and an impartial pope, Martin V, established himself in Rome, Avignon remained under papal rule. Avignon and Comtat Venaissin (now the Vaucluse département) were ruled by papal legates until 1791.