In 1857 the Great Western Railway built its Devizes branch line eastward to Devizes, from Holt Junction on its - line, to a station just south of the market place. In 1862 GWR extended the Reading-Hungerford line westward to meet this line, providing a direct route between and the West Country through Devizes. Pans Lane Halt, southeast of the town in the suburb of Wick, opened in 1929. The building of a by-pass line through Westbury in 1900 diverted most traffic from the Devizes line and British Rail closed it in 1966; the station was demolished soon after. Today the nearest railway stations are at , Chippenham and , although there is a proposal to open a station on the Westbury line at Lydeway, southeast of the town.