Martinsburg is a city in and the county seat of Berkeley County, West Virginia, United States,[5] in the tip of the state's Eastern Panhandle region in the upper Shenandoah Valley. Its population was 17,465 in the 2018 census estimate, making it the largest city in the Eastern Panhandle and the eighth-largest municipality in the state.