After the American Revolutionary War, West Florida south of the 31st parallel became a part of Spain while most of the rest was put in the Mississippi Territory. The territorial assembly established some of the earliest county divisions which have survived to the present. In 1817 the western part of the territory became the State of Mississippi and the remainder the Alabama Territory. The Alabama territorial legislature made some more counties.