In 1788, Raleigh was selected as the location of the new capital because of its centralized location, which made it immune to invasions from the coast.