Texas had declared it's independence from Mexico in 1836 and had maintained its independence as a result of its victory in the Texas Revolution. Mexico still considered Texas to be part of its territory, and threatened war with the United States should the U.S. annex Texas. Further controversy arose because many Americans worried that annexing Texas, permitting slavery, would upset the sectional balance within Congress.
Tyler was on the outs with his party, the Whigs, after he failed to follow the directions of Henry Clay when Tyler became president on the death of William Henry Harrison. Tyler believed that annexing Texas was a way he could achieve political respectability. He formed a new party, called the Democratic Republicans, which used the slogan "Tyler and Texas!"
In 1844 Tyler appointed John C. Calhoun as his Secretary of State. Calhoun was responsible for the negotiations with Texas over its admission to the Union. Calhoun was also a leading advocate of slavery, and his attempts to get an annexation treaty passed were resisted by abolitionists. Martin Van Buren also was against annexation despite the fact that his predecessor Andrew Jackson was very much for annexation. In the end the United States Senate rejected it, 16-35.
Tyler wanted the issue of the annexation of Texas to be the foundation of his re-election campaign. After the annexation treaty was rejected, Tyler called for Congress to annex Texas by joint resolution rather than by treaty. Tyler eventually dropped out of the race, but after fellow expansionist James Polk won the election, Tyler announced in his annual message to Congress that "a controlling majority of the people and a large majority of the states have declared in favor of immediate annexation." In late February 1845, the House by a substantial margin and the Senate by a bare 27-25 majority approved a joint resolution offering terms of annexation to Texas. On March 1, three days before the end of his term, Tyler signed the bill into law.
After some debate, Texas accepted the terms, and entered the union on December 29, 1845, as the 28th state. As for poor John Tyler, he was rejected both by the Whigs and by the Democrats. He returned to his home in Virginia, living in political obscurity until 1861 when he played a role in an unsuccessful peace convention that tried to head off the civil war. He died the following year.