On 1 July 1823, the congress of Central America declared absolute independence from Spain, Mexico, and any other foreign nation, including North America and a Republican system of government was established.