The Great Western Railway had opened its main line between London Paddington and in 1841. It was extended westwards through and trains were running through to by 1867. Another route left the main line at Thingley Junction, west of, ran south to in 1848 and was extended to Weymouth in 1857. Both these lines carried trains connecting with ships – from the Channel Islands at Weymouth, and from America at Plymouth – but the GWR was sometimes referred to as the 'Great Way Round' as its routes to these places were longer than the rival London and South Western Railway. In 1895 the GWR started work on laying a second track on the Berks and Hants Extension Railway which was part of a route westwards from to, and on constructing the Stert and Westbury line that would connect the Berks and Hants line with Westbury. The new line was ready for goods traffic on 29 July 1900 and passenger trains started to use the line on 1 October. The new line was long and reduced the distance from Paddington to Westbury and Weymouth by. From 2 July 1906 the line was also carrying trains from Paddington to Penzance due to the opening of the Langport and Castle Cary Railway which shortened this journey by. Westbury station had been rebuilt in 1899 in preparation for the additional trains and two lines were added later to allow non-stop trains to avoid the congested station area. In 1933 a connection from the Stert line ran along a new route to the east of the station and rejoined the main line some distance to the west. Another connection was opened in 1942 to allow westbound trains from the Stert line to run directly to the north towards Chippenham or Bristol, one of many short connecting lines built around the network during World War II. The GWR was nationalised to become the Western Region of British Railways on 1 January 1948. Local passenger trains were withdrawn on the line on 18 April 1966 but it still forms an important link in the London to Penzance Line and carries freight traffic from the quarries in the Mendip Hills towards terminals in London and the South East. The 1942 curve at Westbury also allows it to be used as a diversionary route when the Great Western Main Line through is blocked.
Stations
Unless otherwise stated, all stations were open for passenger traffic from 29 July 1900 to 18 April 1966. The station buildings were constructed in brick and all stations had a covered footbridge to link the platforms.
When the Berks and Hants Extension Railway had opened in 1862 the nearest station to Patney had been at Woodborough. With the construction of the Stert line a new junction station was provided north of the village and it opened for passengers on 29 July 1900. Known initially as 'Patney Bridge', this was soon changed to avoid confusion with Putney Bridge station in London. Chirton is another village a short distance beyond Patney. The main building was on the westbound platform, from where a road led to the village. Opposite this was a double-sided platform with a smaller building; trains from Westbury used one face of the platform, and those to and from Devizes used the other. A signal box was situated west of the main platform and a small goods yard was located behind this but this was not in use until 1904. A military training exercise in 1909 prompted the building of a fourth platform. This 'military platform' was north of the main station and had its own access road. It was taken out of use in the 1950s. The goods yard closed on 19 May 1964 and the station was unstaffed from November 1965. The signal box closed in 1966, and the station was demolished soon after. Just the footbridge remains.
This station was situated where the line passed close to Littleton Panell on an embankment but was named to reflect two larger communities: Market Lavington and West Lavington. The main building was on the westbound platform and a waiting room was built on the eastbound. The goods yard was at the southwest of the station and the West signal box was opposite. A second East signal box on the south side of the line was open from about 1903 to 1914, when it was removed to allow the platforms to be lengthened. The first signal box was retained for occasional use after the station closed until 1979. The goods yard closed on 3 April 1967 and a scrapyard now occupies the site. The largest engineering structure on the line is the brick viaduct at Lavington. Situated east of the station, it is long and up to high.
The station at Edington opened for goods traffic on 29 July 1900, a month before passenger trains were allowed to use the line. The village of Bratton is about distant. A brick building containing the main facilities stood on the westbound platform and a waiting shelter was provided for passengers travelling eastwards. The goods shed was to the west of the main building. Passenger trains no longer called after 3 November 1952 and the buildings were demolished, but the goods shed and yard remained open for traffic until 25 March 1963. The site is now an industrial estate.
Westbury
The station at Westbury opened on 5 September 1848 as the terminus of a line from. Lines continued to both and and were all served by the same small station with a wooden train shed covering the platforms. In 1899 it was rebuilt with two platforms, each served by two tracks. The station offices were at road level on the east side of the station, and access to the platforms was by a subway at the same level. In 1984 the easternmost track was taken out of passenger use but in 2013 the Swindon and WiltshireLocal Transport Body prioritised its reopening at an estimated cost of £5.4m. Although the locomotive sheds have long gone, the station remains a busy junction with extensive goods yards. A signal box north of the station was opened in 1984 and controls the whole of the Westbury area and of the main line from east of Lavington as far as.