Until the fall of the Royalist stronghold of Lima in 1821, and the Battle of Ayacucho of 1824, territorial integrity was solely sustained by the military brilliance of Generals José de San Martín and Manuel Belgrano, the continuous efforts of northern provinces defenders Martín Miguel de Güemes and Juana Azurduy, among many others. However, during this same period, internecine power conflicts among diverse leaders, and ideological and economical struggles developed between Buenos Aires Province and much of the rest of the United Provinces, with many of the Provinces bonding themselves into a Federal League, inspired by "Federalist" José Gervasio Artigas' leadership. In practice, each side treated the other's grievances as a "foreign policy" matter.