The Salisbury branch line of the Great Western Railway (GWR) from Westbury in Wiltshire, England, was completed in 1856. Most of the smaller stations were closed in 1955 but the line remains in use as part of the Wessex Main Line.
In 1844 the Great Western Railway (GWR) and the London and South Western Railway (LSWR) were engaged in a struggle to secure territory, known as the gauge war: the GWR lines were broad gauge and the LSWR were standard gauge, sometimes called "narrow gauge" for contrast. When the LSWR proposed a new line from Basingstoke to Newbury and Swindon, the GWR sought to fend it off with their own proposal, a branch line from their main line at Thingley Junction, west of Chippenham, to Salisbury. In this period Government policy was that any general area could only support one railway line, and a Commission appointed by the Board of Trade would appraise rival proposals and determine which should be permitted. In this case the GWR scheme won, by decision in December 1844.
The Wilts and Somerset Railway company was formed; nominally independent but heavily supported by the GWR. It planned to make a line from Thingley to Salisbury with branches to Devizes, Bradford on Avon, Frome and Radstock. It was to have capital of £650,000 and this would be secured on a guarantee by the GWR, which was to subscribe half the capital and to lease and work the line.
To join with other friendly railways, the plans for the Wilts and Somerset line were extended to reach Weymouth via Yeovil, and the Company was now to be called the Wilts, Somerset and Weymouth Railway.
The Wilts, Somerset and Weymouth Railway obtained its authorising Act of Parliament on 30 June 1845. The simple scheme to connect Thingley and Salisbury was now to cost £1.5 million, and branches were to be built to Weymouth, Devizes, Bradford on Avon, Radstock, Sherborne and Bridport in addition; a total of 148 miles. The Company proceeded with building the Thingley to Westbury section, and this opened to the public on 5 September 1848. From the summer of 1847 the reaction to the Railway Mania had set in and it became almost impossible to obtain money for railway projects. Construction of the Westbury to Warminster section was started from March 1850, but the Company was already running out of money, and in October 1849 the decision had been taken to sell to the GWR; this took legal effect on 3 July 1851.