Martinsburg is a city in and the county seat of Berkeley County, West Virginia, United States, in the tip of the state's Eastern Panhandle region. Its population was 17,227 at the 2010 census, making it the largest city in the Eastern Panhandle and the ninth-largest municipality in the state. Martinsburg is part of the Hagerstown-Martinsburg, MD-WV Metropolitan Statistical Area.