The route follows the route of the King's Highway that linked Lancaster and Philadelphia in colonial times and is, in fact, named King's Highway during the first few miles of its length near Thorndale. PA 340 was first designated in 1928 between US 222/PA 240 east of Lancaster and US 30/PA 1 in Gap, following its current route to White Horse before turning south to Gap. In 1937, the route was extended east to US 30 in Coatesville by heading east along its current route to Wagontown and turning south to Coatesville, with PA 897 replacing the former route between White Horse and Gap. By 1940, the route was extended west to US 22 in Harrisburg, heading west to Marietta, north to Hershey, northwest to Union Deposit, and west to Harrisburg. PA 340 was rerouted to end at US 30 in Thorndale during the 1940s. In the 1950s, the west end was cut back to US 422 in Hershey. The western terminus was scaled back to PA 441 in Marietta by 1962 and its current location by 1970, with the former alignment now PA 743 between Hershey and Marietta and PA 23 between Marietta and Lancaster.