With the advent of Mexican independence in 1821, and the Texas revolution soon after in 1836, the Anglo-American population in the Republic of Texas began to grow rapidly. The island quickly became Texas' primary port and a destination for immigration. Following Texas' annexation by the United States in 1845, the island's population soon surpassed the population of San Antonio. It became the state's major population center, a title it would hold until nearly the end of the 19th century. Galveston for a time before the American Civil War was the largest cotton shipping port in the world and the second-largest port for immigration in the United States. In the mid-19th century, it was a major port of entry for the many Germans who entered the state.