After the defeat in the Battle of Chacabuco the Spanish government ordered "Esmeralda" to sail from Cadiz on 6 May 1817 under the command of Captain Luis Goic with a convoy that included the ships "Reina de los Ángeles", "San José", "San Juan", "Castilla", "Tagle", and "Primorosa Mariana". The convoy arrived in Callao on 30 September 1817; "Tagle" had already arrived on 21 August.