Royalist forces in the area in a series of initially successful battles. After stopping to reorganize the city's government and his own forces, he pressed on towards Pasto. Historians have speculated that, had he not stopped at Popayán but actually decisively pursued the fleeing Royalist army, he might have been able to successfully capture a relatively undefended Pasto. As things went, however, the constant raids by Royalist guerrillas, the harshness of the terrain, the lack of promised reinforcements from Antioquia, and the delays in bringing up his army's artillery contributed to weakening the morale of many of the troops under Nariño's command, when they had practically reached the gates of Pasto. On May 10, 1814, in the Battle of the Ejidos (Commons) of Pasto, the royalist army led by Melchior Aymerich attacked Nariño's army. After being wounded during combat, a false rumor of his death was spread, and most of the remaining soldiers scattered, only some 400 returning to Popayán. Waiting for reinforcements, Nariño decided to send his officers back to Popayán while he harangued his few remaining troops. Nariño was left practically alone in the battlefield, and attempted to hide in the surrounding mountains, but finally surrendered himself when Royalist scouts found him, hungry and exhausted, on May 14. He had hoped he would be able to negotiate an armistice. He was taken into Pasto in May 1814, and then sent to the Royal prison at Cádiz via Quito on July 15, 1815. From there, he was sent to Lima, where he was taken by ship to Cádiz, arriving on the first weeks of March, 1816. Nariño would remain a prisoner in Cádiz for the next four years. Later years Nariño was freed from imprisonment in 1821, following the revolt of Rafael del Riego, and returned to his home country, Colombia, now independent from Spain after the republican victory at the Battle of Boyacá. Nariño was one of the candidates for election to the presidency of Gran Colombia in 1821, which he lost to Simón Bolívar by the significant margin of 50 to 6 votes in the Congress held at Cúcuta, finishing second. He also lost the election for vice president, with Francisco de Paula Santander (a former federalist soldier) eventually defeated by a 38 to 19 vote margin after several heated rounds of voting. Santander and others had been victorious in battle, while Nariño was not, and his