Texas is the only state in the nation to have been under six separate flags. The flag of Spain was the first to fly over Texas from 1519 to 1821, when the Spanish explorers came to Texas. The French concurrently flew their flag over Texas from 1685 until 1690 starting with the French explorer Robert La Salle. The flag of Mexico flew over Texas beginning in 1821 when Mexico gained independence from Spain and the region of Texas became part of Mexico. On April 21, 1836, Texas won independence from Mexico at the battle of San Jacinto and became the Republic of Texas. The Republic flag flew from 1836 until 1845 when the Civil War broke out, whereupon the State of Texas joined with the Southern Confederate states. The Confederate States flag flew from 1861 to 1865. The United States flag flew over Texas from 1845 until 1861 and then again starting in 1870, when Texas was readmitted to the Union.