Mechanicsburg is a borough in Cumberland County, Pennsylvania, USA, eight miles (13 km) west of Harrisburg. It is part of the Harrisburg–Carlisle Metropolitan Statistical Area. Mechanicsburg was settled in 1806 and incorporated as a borough on April 12, 1828. It is in a rich agricultural region known as the Cumberland Valley, a broad zone between South Mountain and the ridge-and-valley Appalachians. In 1900, 3,841 people lived here; in 1910, 4,469, which increased to 5,709 in 1940.