It remained an independent country for ten years. In 1845, the United States Congress voted to admit Texas as a slave state, which made it the country's 28th state. Mexico was angry and so the Mexican–American War began.