Rail transport was first introduced in Burma in May 1877, when Lower Burma was a colony of the United Kingdom and a part of British India, with the opening of the Rangoon to Prome line by The Irrawaddy Valley State Railway. This line, 163 miles long, tracing the course of the Irrawaddy river, was built over three years with labour imported from India, particularly from the areas affected by the Bihar famine of 1873–74. In 1884, a new company, The Sittang Valley State Railway, opened a 166-mile line along the Sittang River from Rangoon to the town of Toungoo via Pegu. While the Irrawaddy line was considered to be of commercial importance because it could be used to move rice from the valley to the main port at Rangoon, the Sittang line was of considerable strategic importance because of the proximity of Toungoo to the border with Upper Burma, then a part of the Ava kingdom. This became evident at the start of the Third Anglo-Burmese War a year after the opening of the railway and during the unrest that followed the war. The construction cost for the two lines was £1,926,666 and the railway was profitable by 1888 returning more than 5% on the capital expenditure.
With the annexation of Upper Burma, the railway was extended by 220 miles from Toungoo to Mandalay, the fallen capital of the Ava kingdom with the extended railroad opening in 1889. Following the opening of this section, the Mu Valley State Railway was formed and construction began on a railway line from Sagaing to Myitkyina and connected Mandalay to Shwebo in 1891, to Wuntho in 1893, to Katha in 1895, and to Myitkyina in 1898. With the opening of this railway, a continuous 724 mile railway line ran from Rangoon to Myitkyina through the Kachin Hills except for a ferry crossing of the Irrawaddy at Sagaing. The Inwa Bridge at Sagaing, the only one across the Irrawaddy River in Burma, was opened in 1934, with two decks, one for road traffic and one for rail traffic. Destroyed by the British during their retreat from Burma in the Second World War it was rebuilt in 1954 after Burmese independence.