Ayrshire & Galloway Railway letterhead 1846
In 1846 the Ayrshire and Galloway Railway Company planned a railway from Ayr to Dalmellington and then on southwards via the Glenkens to a new port at Balcary Bay on the Solway coast. The connection to Galloway did not materialise, but the proposal led to the opening of the Dalmellington Iron Works and its associated collieries (including Cumlarg) in 1848, although it took another eight years before the railway from Ayr reached Dalmellington. Had coal existed to be discovered in Galloway, the resulting industrial developments may have held back agricultural improvement as it did in west Cumberland. A difficult railway to build and with poor finances it relied on the larger Glasgow,Portpatrick, Kilmarnock and Ayr Railway as a major shareholder to construct a line from Ayr to Dalmellington. The GPK&A Railway became the Glasgow and South Western Railway on 25 October 1850 by which time only a very short stretch of the Ayrshire and Galloway had been build at the Dalmellington end near Sillyhole. Eventually, thanks to the intervention of the G&SWR; the line opened to goods and mineral trains on 15 May 1856; the opening to passengers was delayed due to washouts of earthworks, but it took place on 7 August 1856.The line was difficult to work, with gradients of 1 in 70 and 1 in 90 climbing to Dalmellington, and numerous mineral tramway connections. At Ayr it diverged (considered in the southward direction) from the G&SWR Ayr line at Falkland Junction, crossing the River Ayr. A new through station at Townhead was provided, a temporary structure until 1 July 1857. The line was worked by the G&SWR, but ordinary G&SWR trains continued to use the old terminus on the north side of the River Ayr until January 1860 when it was downgraded to goods depot status, all passenger trains using the new through station. The GS&WR was working the line and had paid most of the cost of construction; it was only a matter of time until they took over the company, and they did so on 1 August 1858 (by Act of 28 June 1858).