The eastern boundary of the purchase, the Mississippi River, functioned as the territory's eastern limit. Its northern and western boundaries, however, were indefinite, and remained so throughout its existence. The northern boundary with the British territory of Rupert's Land was established by the Treaty of 1818, and the western boundary with the Spanish viceroyalty of New Spain was defined by the Adams–Onís Treaty of 1819.