The Edict of Nantes was weakened during the reign of King Louis XIII, with many of the fortress towns being captured by the government. In 1685, King Louis XIV replaced the Edict of Nantes with the Edict of Fontainebleau, which banned people from being Protestant. This made many Huguenots leave the country, and a hundred years later there were not many left. In 1787, King Louis XVI made it legal for people to be Protestant again. During the French Revolution a few years later, France gave people full freedom of religion.