Elgin is a city in Bastrop County in the U.S. state of Texas. The population was 9,784 at the 2020 census. In 1995, the Texas Legislature proclaimed Elgin the "Sausage Capital of Texas". Elgin is also known as the Brick Capital of the Southwest due to the presence of three operating brickyards in the mid-20th century.