 Belgrano was appointed as captain of the urban militias in 1797 by viceroy Pedro de Melo, who was instructed by Spain to prepare defences against a possible British or Portuguese attack. Belgrano by then worked in the Consulate, and was no longer interested in pursuing a military career. Viceroy Rafael de Sobremonte requested that he create a militia to counter a possible British attack, but he did not take interest in it. His first intervention in a military conflict took place when the British, under William Carr Beresford, arrived with 1,600 men and took Buenos Aires, starting the British invasions of the Río de la Plata. Belgrano moved to the fortress as soon as he heard the warning, and gathered many men to launch resistance. But without the required knowledge, his men marched in disorder and Belgrano was ordered to disband after a single British cannon shot. Belgrano would write later in his autobiography that he regretted not having by then even the most basic knowledge of militia work.
