Paraguay overthrew the local Spanish administration on 14 May 1811. Paraguay’s first ruler was the dictator José Gaspar Rodríguez de Francia. He ruled Paraguay from 1814 until his death in 1840, with very little outside contact or influence. He intended to create a utopian society based on the French theorist Jean-Jacques Rousseau's Social Contract.[9] Rodríguez de Francia established new laws that reduced the powers of the church (Catholicism was then an established state religion) and the cabinet, forbade colonial citizens from marrying one another and allowed them to marry only blacks, mulattoes or natives, to create a mixed-race or mestizo society.[10] He cut off relations between Paraguay and the rest of South America. Because of De Francia’s restrictions on personal freedom, Fulgencio Yegros and several other military leaders and former politicians, planned a coup d’état against him. De Francia discovered the plot and had its leaders either executed or imprisoned for life.
After De Francia's death in 1840, Paraguay was ruled by various military officers under a new junta, until the secretary Carlos Antonio López, De Francia’s nephew, declared himself dictator. López modernized Paraguay and opened it up to foreign commerce. He developed a non-aggression pact with Argentina and declared independence from the state[clarification needed] in 1842. After López’s death in 1862, power was transferred to his eldest son, Francisco Solano López.