In 1836 Texas rebelled, defeating the Mexican army and created a republic. Although General Santa Anna had signed a treaty with the Texans acknowledging their independence, the agreement was not recognized by the Mexican government, which still claimed it as part of its national territory.