The first constitution of the Mexican republic was drafted after the demise of the short-lived monarchy of Agustin I, the first independent post-colonial state in Mexico after the Mexican War of Independence wrested control from Spain. This constitution was modeled on the Spanish Constitution of 1812.