 Plans to build a railway to connect Norway 's two largest cities , Oslo and Bergen , were launched by Andreas Tanberg Gløersen in 1871 . He proposed that the line run via Hallingdal and Voss and include two short branch lines which would connect to the two major fjord systems in the area , Sognefjord and Hardangerfjord . The narrow gauge Voss Line from Bergen to Voss opened in 1883 , and the Bergen Line was completed as standard gauge in 1909 . During the construction of the Bergen Line , the path that ran up Flåmsdalen was upgraded by NSB to allow access to the area around Myrdal . The Hardanger Line , which connected the Bergen Line to Hardangerfjord , opened in 1935 , and was the country 's first railway to open with electric traction . 
