Montgomery is the capital of the U.S. state of Alabama, and is the county seat of Montgomery County. It is located southeast of the center of the state, in the Gulf Coastal Plain. Montgomery is the primary city of the Montgomery Metropolitan Statistical Area. The city was incorporated in 1819, as a merger of two towns situated along the Alabama River. It became the state capital in 1846. In February 1861, Montgomery was selected as the first capital of the Confederate States of America, until the seat of government moved to Richmond, Virginia in May of that year.