A state capital is the city in a state within the United States of America in which the state legislature and major government offices are located. This is a necessarily loose definition because the location of a state’s capital is typically decided by the legislature of the state itself, with little in the way of hard rules regarding the location and establishment of state capitals. Population and city size are not prerequisites for a city to serve as a capital, and many capitals are not the most populated or largest cities within a state.
The state capital is usually the seat of political power within that state, and typically houses the state legislature and executive offices. The state Supreme Court is also often located in the capital city and offices for various major federal government agencies may be located there as well. There is not typically a geographical requirement for a city being a capital, with some capitals being located along the borders of other states or countries.
Once a state capital is established, it is also not required that the location remain the capital of the state for any particular length of time. Some states have had numerous capitals over their history, and many capital cities served as capitals even before the state they are within became a state in the US. This often happened due to a state being a colony before the establishment of the country, existing as part of an independent territory, or by being a part of another country before becoming a state within the US.
Boston, Massachusetts, has been a capital for the longest consecutive period of time, having been a capital of either a colony or a state since 1630. The state capital of New Mexico, Santa Fe, has been a capital since 1610, but this was interrupted during the Pueblo Revolt in 1680 when the Pueblo people laid siege to the city and drove out the Spanish government. This lasted until 1692 when the Spanish successfully took back the city and re-established it as the capital of the New Mexico province of New Spain.