The San Juan Islands were the subject of a territorial dispute between Great Britain and the United States from 1846 to 1872, leading to the Pig War in 1859.