Mexican–American War from the war of independence (1810–1821) as a weak and divided force. Before the war with the United States, the military faced both internal and foreign challenges. The Spanish still occupied the coastal fortress of San Juan de Ulúa, and Spain did not recognize Mexico's independence, so that the new nation was at risk for invasion. In 1829, the Spanish attempted to reconquer their former colony and Antonio López de Santa Anna became a national hero defending the homeland. The army had a set of privileges ("fueros"), established in the colonial era, that gave it jurisdiction over many aspects of
Rancho Santiago de Santa Ana County given under Spanish Rule which were rare during this time. This was only two and a half months before the start of the war for Mexican Independence (1810-1821). The surrounding land grants or ranchos were granted by the Mexican government after Mexican independence in 1821. José Antonio Yorba built an elaborate adobe hacienda, El Refugio (the Refuge), located near present-day First and Sullivan Streets in western Santa Ana. With the Mexican Cession of California to the United States following the Mexican-American War, the 1848 Treaty of Guadalupe Hidalgo provided that the land grants would be honored. As required by