Bernardo and thousands of Chileans stayed in Argentina for three years while they gathered support, honed their battle skills and made plans to retake Chile. In January 1817 O'Higgins returned to Chile with the Argentine general José de San Martín in a march over the Andes that has been compared to Hannibal's crossing the Alps. They met and defeated the royalists on February 12 at Casas de Chacabuco and took Santiago.
San Martín was offered the governorship of which he refused in order to continue the battles against the Spanish and his objective of capturing Lima. Instead, Bernardo O'Higgins became Director Supremo de Chile.
The battles did not end here. Skirmishes and confrontations resulted in the Battle of Maipú on April 5, 1818. The six-hour battle left 2,000 Spaniards dead and 3,000 captured; the patriots lost about 1,000 men. It ended the struggle for Chilean independence.
Don Bernardo O'Higgins now held supreme power in Chile. Where he had once been a little boy kept out of sight, he was now celebrated and feted. His half-sister, Doña Rosa Rodríguez Riquelme took his surname and his mother acknowledged him. He fathered a son, Demetrius, though like his father, he never married.
He turned his attention to building the country, as his father had done before him. He created a new government, a republic, and laid the grounds for peace and order. He instituted reforms in the economic and social order, and with the help of San Martín and Thomas Cochrane (later 10th Earl of DunDonald), he created the Chilean navy and the accumulation of troop ships. This fledgling navy took part in the conquest of Peru in 1821, and San Martín became protector of Peru.
With this accomplished, Don Bernardo focused on the situation at home, particulary the legal, educational and social systems. He established courts, colleges, libraries, hospitals, cemeteries and modernised the cities. He was energetic and honest, but he moved too quickly for the established pillars of society.
His reputation was built on military prowess during the battles for independence and now his association with foreign armies, particularly those of Argentine origin, was not enough for the political and civil struggles in Chile. He had angered the church and the powerful oligarchy with his reforms and they now turned on him. He also antagonized the business sector, and with a lack of a political base, he was stifled in his attempts to govern.
In 1823, he agreed to resign and left the country with his mother, his sister and his son, to settle in Lima. Embittered by the failure of his countrymen to appreciate and adopt his reforms, Don Bernardo and his family lived on the haciendas of Montalbán y Cuiba, given to him in gratitude by the new Peruvian government. He busied himself with managing the land, and worked to continue the independence movement of other South American countries as well as fostering a community of Latin American republics.
His health began to fail, and though he was given permission to return to Chile, he suffered a heart attack and was unable to travel. Despite his deteriorating health, he managed to recommend the colonization of the Straits of Magellan and the accompanying strengthening of the navy to the Chilean government.
He died in Lima on October 24, 1842. His last words were "¡Magallanes, Magallanes...!". He was buried with great honor in Lima. In 1866 his remains were brought back to Chile by the Chilean navy and buried in the Cementerio General de Santiago, again with great honors as a hero of the Independence.
The bicentenary of his birth, 1978, was named the Year of the Libertador Bernardo O`Higgins. In 1979, on his birthday, his remains were moved, with pomp and ceremony to the Altar de la Patria.
Don Bernardo O'Higgins is remembered and honored throughout Chile with streets, schools, national parks and thousands of boys named after him.
Not bad for an illegitimate Irish-Chilean little boy who wasn't expected to amount to anything.

