Bernardo O'Higgins Riquelme ( ; 1778 -- 1842 ) was a Chilean independence leader who , together with José de San Martín , freed Chile from Spanish rule in the Chilean War of Independence .
Bernardo O'Higgins Riquelme ( 1778 -- 1842 ) was a Chilean independence leader . Along with José de San Martín , hs is credited with liberating Chile from Spanish rule .