Martinsburg is a city in and the county seat of Berkeley County, West Virginia, United States, in 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 one of the core cities in the Hagerstown-Martinsburg, MD-WV Metropolitan Statistical Area. Martinsburg was a European-American settlement founded on the upper Potomac River in 1778 during the American Revolutionary War by General Adam Stephen. He named it in honor of Colonel Thomas Bryan Martin, a nephew of Thomas Fairfax, 6th Lord Fairfax of Cameron.