After Francia's death in 1840, Paraguay was ruled by various military officers under a new ''junta'', until Carlos Antonio López (allegedly Rodríguez de Francia's nephew) came to power in 1841. López modernized Paraguay and opened it to foreign commerce. He signed a non-aggression pact with Argentina and officially declared independence of Paraguay in 1842. After López's death in 1862, power was transferred to his eldest son, Francisco Solano López.