The cannon which roared a welcome to the Spanish squadron at Talcahuano, were heard by the Patriot army then in full retreat upon the capital. Osorio saw at once that he had failed to surprise the enemy, and that all chance of an easy landing in the neighbourhood of Valparaiso was at an end. He despatched the squadron to blockade that port, and after fifteen days spent in organizing his forces at Concepcion, he marched for the North, stimulated to activity by Ordoñez. On the 12th February his advanced posts on the Maule heard the salute fired by O’Higgins at Talca, in celebration of the first anniversary of Chacabuco.
The rôles were now changed; the general of the Army of the Andes, instead of choosing the place of invasion on a line of 1,300 miles of Cordillera, had now to defend 1,300 miles of coast. He expected the enemy to land near Valparaiso, and in December had written to O’Higgins to make every preparation for a rapid retreat, leaving the country behind him destitute of horses and supplies. O’Higgins commenced his retreat on the 1st January, 1818, and on the 20th reached Talca, accompanied by more than 50,000 people with their cattle and horses, and there proclaimed triumphantly the Independence of the Chilian Republic, which, in default of a Congress, had been decreed by a general vote of the Chilian people on the 17th November previous.
At Santiago, Don Luis de la Cruz, Deputy Director, presided at a solemn ceremony in the great square. Guido was the bearer of the standard of the new Nation; beside it the President of the Municipality carried that of the United Provinces. The Declaration of Independence being read, De la Cruz was the first to swear to maintain it, he was followed by the Bishop and by San Martin; then the people kneeling down, repeated the oath, and commemorative medals were distributed among them.
Meantime San Martin had drawn the greater part of his troops from the city and had established an encampment at Las Tablas near the coast, in readiness to meet the enemy at any point, giving the command there to Balcarce, and looking himself to the construction of bridges over the rivers to the south of Santiago, to facilitate the concentration of the different corps when requisite.
By the end of February he was no longer in doubt as to the intentions of the enemy. O’Higgins was directed to evacuate Talca and retreat sixty miles to the north. Early in March the concentration was complete, and San Martin had under his command 4,500 infantry, 1,500 cavalry and thirty-three guns.
On the 4th March, Osorio crossed the Maule and encamped at Talca. On the 14th the united army broke up from quarters and marched against him. The same day the Royalist army left Talca, and Primo de Rivera, chief of the staff, crossed the river Lontué with a strong detachment of infantry and cavalry to reconnoitre the position and force of the Patriots, of which Osorio as yet knew nothing, recrossing the river the same night. On the 15th, Freyre, supported by Brayer with the bulk of the cavalry and eight guns, crossed the river with 200 light horse, advanced to Quecheraguas, where the Royalist vanguard was quartered, and summoned Primo de Rivera to surrender, but receiving no support from Brayer, who did not even cross the river, he was forced to retire with the loss of seventeen men. Rivera after this success retreated upon his reserves at Camarico.
On the 16th, the entire Patriot army crossed the Lontué and encamped at Quecheraguas, while Osorio retired precipitately. San Martin, afraid that he would repass the Maule, marched inland to cut him off. The two armies marched on parallel lines at a distance of only seven miles one from the other; both crossed the Lircay on the 19th. On the afternoon of the same day, Osorio, whose rear was greatly harassed by the Patriot cavalry under Balcarce, wheeled into line in an excellent position, his right resting on the suburbs of Talca, his left on the Claro River, and his front defended by a stretch of broken ground known as the Cancha-Rayada, which he occupied with 500 horse. Balcarce, ignorant of the nature of the ground, charged this advanced corps, and coming under fire of the Royalist artillery, was compelled to retire in disorder. O’Higgins, with twenty guns, forced back the enemy’s right wing into the suburbs of Talca, but as darkness came on, decisive action had to be postponed till next day.
In the twilight the Royalist generals, after gazing upon the Patriot army from the church towers of Talca, held a council of war. Before them was an enemy greatly superior in numbers, behind them flowed a deep and rapid river. Osorio talked of continuing the retreat to Talcahuano, but was overruled by Ordoñez, who said that the attempt could only result in the total destruction of the army, and advised a night attack upon the Patriot position. Most of the officers supported him, and Osorio retired to a convent, leaving him in command. At 8 P.M., under a cloudy sky, Ordoñez drew up his army in line of battle, with cavalry on the wings and guns in the intervals between the different battalions. He himself took charge of the centre, Primo de Rivera led the right wing and Colonel Latorre the left; so, in deep silence, they marched across the Cancha-Rayada, straight upon the watch-fires of the Patriot vanguard.
Meantime San Martin, warned by a spy of what was going forward in the Royalist camp, and seeing that his troops were in the worst possible position to resist a night attack, had marched several battalions and the Chilian artillery from his front to a strong position on his extreme right. The broken nature of the ground much retarded the manœuvre, and the rest of the army had not moved at all when the cavalry outposts gave warning of the approach of the enemy.
The right of the Royalist army, having the least distance to march, was the first to come into action, and was received by O’Higgins with so heavy a fire, whilst at the same time a detached company under Captain Dehesa opened fire on their left, that for a moment the advance was checked, till Ordoñez in person led them again to the charge. O’Higgins had his horse killed under him and received a ball in the elbow. From this moment all was confusion in the Patriot camp. The artillery was abandoned and the grenadiers on the extreme left, roused from sleep by the firing, fled in a panic. The cavalry of the right retired upon the reserves, and were received by a volley of musketry under the belief that they were Spaniards. Alvarado, with the 1st Light Infantry, passed behind the Royalist line and joined the right wing, being also taken for a Spanish corps and losing twenty-one men by the fire of his own friends before the mistake was discovered. The 2nd Chilian infantry, under command of an Italian officer, moved to the rear, and also reached the right wing in safety.