 Chile won its formal independence when San Martín defeated the last large Spanish force on Chilean soil at the Battle of Maipú on April 5, 1818.San Martín then led his Argentine and Chilean followers north to liberate Peru; and fighting continued in Chile's southern provinces, the bastion of the royalists, until 1826.A declaration of independence was officially issued by Chile on February 12, 1818 and formally recognized by Spain in 1840, when full diplomatic relations were established.