Old English burg, burh "a dwelling or dwellings within a fortified enclosure," from Proto-Germanic *burgs "hill fort, fortress" (source also of Old Frisian burich "castle, city," Old Norse borg "wall, castle," Old High German burg, buruc "fortified place, citadel," German Burg "castle," Gothic baurgs "city"), which Watkins derives from from PIE root *bhergh- (2) "high," with derivatives referring to hills, hill forts, and fortified elevations.
In German and Old Norse, chiefly as "fortress, castle;" in Gothic, "town, civic community." Meaning shifted in Old English from "fortress," to "fortified town," then simply "town" (16c., especially one possessing municipal organization or sending representatives to Parliament). In some U.S. states (originally Pennsylvania, 1718) often an incorporated town; in Alaska, however, it is the equivalent of a county. As one of the five administrative divisions of New York City, it dates from the consolidation of 1898; in London, its use dates from the London Government Act of 1899.
The Scottish form is burgh. The Old English dative singular byrig survives in many place names as -bury.