In 1840, an army of exiled Unitarios attempted to invade northern Argentina from Uruguay but had little success. In 1842 the Argentinian army overran Uruguay on Oribe's behalf. They seized most of the country but failed to take the capital. The Great Siege of Montevideo, which began in February 1843, lasted nine years. The besieged Uruguayans called on resident foreigners for help. French and Italian legions were formed. The latter was led by the exiled Giuseppe Garibaldi, who was working as a mathematics teacher in Montevideo when the war broke out. Garibaldi was also made head of the Uruguayan navy.