Mexico gained its independence shortly after the United States and Spain ratified the Adams–Onís Treaty, and the Adams administration approached Mexico about a renegotiation of the Mexico–United States border. Joel Roberts Poinsett, the ambassador to Mexico, unsuccessfully attempted to purchase Texas. In 1826, American settlers in Texas launched the Fredonian Rebellion, but Adams prevented the United States from becoming directly involved.