The Main North Line between Picton and Christchurch and the Main South Line between Lyttelton and Invercargill, running down the east coast of the South Island of New Zealand, are sometimes together referred to collectively as the South Island Main Trunk Railway (SIMT). Construction of a line running the length of the east coast began in the 1860s and was completed all the way from Picton to Invercargill in 1945; the last sections being on the Main North Line south of Picton. The designation "South Island Main Trunk" originally referred to only that line between Christchurch and Invercargill.
Construction of the Main South Line (originally known as the "Great Southern Railway") began in 1865 when the Canterbury Provincial Railways began work on a broad gauge line south from Christchurch. It reached Rolleston on 13 October 1866 and Selwyn a year later. A number of routes south were considered, and the one chosen was a compromise between a proposal to build a coastal line through the fertile territory and a proposal to build an inland line to achieve easier crossings of rivers such as the Rakaia. Construction had to be postponed as the Canterbury Province government was low on funds, and it did not restart until Julius Vogel announced the central government's "Great Public Works Policy".
The "Great Public Works Policy" placed a high priority on the completion of the Main South Line. At this time, the central government had decided on narrow gauge as New Zealand's national rail gauge, but Canterbury was permitted to extend its broad gauge as far as Rakaia - although it did so on 2 June 1873, it converted its entire network to narrow gauge by 6 March 1876. Further south, the Dunedin and Port Chalmers Railway was opened on 1 January 1873 as the first railway in the country to adhere to the new national gauge. Although the final portion of this line became the Port Chalmers Branch, most of it was incorporated into the mainline northwards and construction progressed through difficult terrain towards Oamaru. South of Dunedin, work was progressing on a link with Invercargill; a line between Invercargill and Gore was opened on 30 August 1875 and a line between Dunedin and Balclutha was opened two days later. Construction to link these sections faced more construction challenges than the earlier work had, and accordingly, the rate of progress slowed.
Over the next three years, the line between Dunedin and Christchurch was constructed; Christchurch and Timaru were linked on 4 February 1876, followed by Oamaru on a year later, and the difficult section between Oamaru and Dunedin was finally completed on 7 September 1878. All that remained was the Balclutha-Gore link, which was opened on 22 January 1879, completing the Main South Line.
Construction of the Main North Line was one of the longest construction projects in New Zealand's history. Through the 1870s, work on a line from Christchurch to northern centres in Canterbury was undertaken, with a line through Kaiapoi, Rangiora, and Amberley reaching Waipara in 1880, and at the other end, a line linking Blenheim and Picton opened in 1875. Further construction was delayed by disputes over proposed routes. Different regions sought to protect their interests by having the line constructed through their area. Some preferred the coastal route via Parnassus and Kaikōura, while others favoured an inland route to Blenheim with a branch from Tophouse to Nelson. There was also a proposal to use the latter route as the trans-Alpine line (as the Midland Line's route was yet to be chosen), linking Waipara with Reefton and then connecting to Nelson and possibly Blenheim via a line up the Buller Gorge.
The people of Marlborough favoured a coastal route and began work south, while in Canterbury, work initially began on an inland route, with Waipara linked to Culverden in 1886. Although the line to Culverden was treated as the mainline for decades, it eventually became part of the Waiau Branch. At the start of the 20th century, work began on a coastal route northwards from Waipara, with the line opened to Parnassus in 1912. Construction then proceeded up the Leader River valley as part of a somewhat inland route to Kaikōura via river valleys, but the start of World War I brought a halt to construction and the 3 km of track laid beyond Parnassus was removed. The war also brought a halt to work at the northern end, with the coastal village of Wharanui established as the terminus of the line south from Blenheim.
The 1920s saw much indecisiveness and disputes over what route to take between Waipara and Wharanui. The Culverden line now ran all the way as Waiau and some work took place on a line to link Waiau with Kaikōura, but after a few kilometres of formation was made, work came to a halt. The coastal route was then chosen and work had only just restarted when the Great Depression began and brought about more severe delays. Fortunes improved in 1936 sufficiently to allow a resumption of progress, and a more coastal route out of Parnassus than the Leader Valley route was chosen. World War II brought even more delays, but this time, construction progressed through wartime and the Main North Line was finally completed when the northern and southern ends met at Kaikōura on 15 December 1945.
The South Island Main Trunk has been famous for its passenger services. In the days of steam locomotives, the South Island Limited expresses were particularly famous; drivers of J and JA class locomotives claimed to have broken the official New Zealand railway speed record on a section of track near Rakaia called the "racetrack". The Main South Line saw the last regularly steam-hauled expresses in New Zealand, with JA locomotives hauling the Friday and Sunday night expresses until 26 October 1971. All other steam-hauled expresses were replaced on 1 December 1970 by the Southerner, which was hauled by DJ class diesel-electric locomotives. This service was one of the most famous in New Zealand, but it ceased on 10 February 2002.
For many years, Fiat or 88-seater railcars ran services on the Main North Line, but they were withdrawn during the 1970s. On 25 September 1988 the tourist-focused Coastal Pacific express began operating along the scenic route between Christchurch and Picton; it continues to operate to this day. In the summer of 1994–95, this service was augmented by the Lynx Express, which was unsuccessful and not repeated in later years. Commuter services used to operate around major centres along the South Island Main Trunk, and many rural services also operated when country branch lines were operational, but the branch lines progressively closed during the 20th century and commuter services in the South Island ceased in the 1980s. Nowadays, the only long-distance passenger services on the South Island Main Trunk are the Coastal Pacific and the TranzAlpine, which uses the short portion of the Main South Line between Christchurch and Rolleston before running along the Midland Line to Greymouth.
Freight services on both lines operated for many years as feeder services from rural districts to nearby major centres and harbours, rather than utilising long-distance services between the important cities. The first through freight from Christchurch to Invercargill did not operate until December 1970. During the 1970s and 1980s, patterns of freight haulage changed dramatically, with the last of the branch lines closing and an emphasis placed upon long-distance haulage. The South Island Main Trunk is now used to carry significant quantities of long-distance freight, and it connects with the North Island via roll-on roll-off ferries between Picton and Wellington. These ferries have allowed freight trains to be operated from Auckland to Christchurch on a 30-hour schedule.