Berkeley County was formed from Frederick County, Virginia in 1772 and named for Lord Norborne Berkeley. For most of Berkeley County's history, Martinsburg has been its largest city. The arrival of the B&O Railroad in the 1840s gave Martinsburg and Berkeley County a significant economic boost. As the American Civil War was being fought, much of Berkeley county was ransacked and fought over. The first major battle in the area occurred on July 2, 1861, when the American General Robert Patterson crossed the Potomac River at Williamsport and defeated the Confederate General Joseph E. Johnston and General Thomas J. “Stonewall” Jackson. In the October of 1862, the Martinsburg B&O Railroad complex and Roundhouses were burned. After November 1863, Berkeley County became a part of West Virginia. Since then, Berkley County has experienced huge growth due to being close to the US capital, Washington, D.C. 