to maintain their position. Former royalists and old insurgents allied under the Plan of Iguala and forged the Army of the Three Guarantees. The momentum of independence saw the collapse of the royal government in Mexico and the Treaty of Córdoba ended the conflict. The mainland of New Spain was organized as the First Mexican Empire, led by Agustín de Iturbide. This ephemeral Catholic monarchy was overthrown and a federal republic was declared in 1823 and codified in the Constitution of 1824. After some Spanish reconquest attempts, including the expedition of Isidro Barradas in 1829, Spain under the rule of Isabella II recognized the independence of Mexico in 1836. Prior challenges to crown rule There is evidence that even from an early period in post-conquest Mexican history, some began articulating the idea of a separate Mexican identity, though at the time this would have occurred only among elite Creole circles. Despite these murmurings of independence, serious challenges to Spanish imperial power before 1810 were rare and relatively isolated. One early challenge to crown authority came from Spanish conquistadors whose encomienda grants, rewards for conquest, were to be ended following the deaths of the current grant holders. The encomenderos' conspiracy included Don Martín Cortés, son of Hernán Cortés. Martín Cortés was exiled, and other conspirators were executed. Another challenge to crown authority occurred in 1624 when elites ousted the reformist Viceroy Marqués de Gelves, who sought to break up rackets from which the elites profited and curtail opulent displays of clerical power. The viceroy was removed following an urban religious riot of Mexico City commoners in 1624 stirred up by the elites. The crowd, which was mostly Catholic, was reported to have shouted, "Long live the King! Love live Christ! Death to bad government! Death to the heretic Lutheran [Viceroy Gelves]! Arrest the viceroy!" The attack was specifically against Gelves, seen as a bad representative of the crown, rather than against the monarchy or colonial rule itself. In 1642, there was a brief conspiracy to unite American-born Spaniards, blacks, Indians and castas against the Spanish crown and proclaim Mexican independence. The man seeking to bring about independendence called himself Don Guillén Lampart y Guzmán, an Irishman with the birthname William Lamport. Lamport's conspiracy was discovered, and he was arrested by the Inquisition in 1642 and executed fifteen years later for sedition. Today, there is a statue of Lamport in the mausoleum