The construction of the railway of Azerbaijan and its further development was closely connected with the oil production and refining. The primitive carvan method of oil transportation in wooden barrels had been used for a long time. Along with being expensive this method hindered the development of oil industry as well. Therefore, the oil producers started to display interest in the construction of railways for the increase of oil profits. Thus, it is possible to say that Baku oil and its industrial production preconditioned the establishment of railway in the entire Azerbaijan.

The railway of Azerbaijan on the oldest highway of the country. It dates back to January 1880. The construction of the railway started in 1878 and completed in 1880 and a railway Baku-Surakhany-Sabunchu designed only for the transportation of oil and extending to 20 kilometers were commissioned at that time. The oil started to be carried in cisterns for the first time in the world. The said day entered the history as the day pf the establishment of railway in Azerbaijan. Beginning from that period the railway developed and improved considering the significant rise in the demands for cargo transportation. The next 20 years were characterized with the rapid development of the railway construction.

The Baku-Tbilisi railway extending to 550 kilometers was commissioned on May 8, 1883 and the Derbend -Biladjary railway extending to 231 kilometers -in 1900. Following the completion of the Derbend-Tikhi\oretskaya line in 1900 Baku joined the Russian railway network in the North direction, thus enabling the transportation of Baku oil to the center of Russia and its west regions by the railway.

The electrizaiton of the railway lines of former USSR was carried out at the Baku-Sabunchu line of Azerbaijan in 1925. The construction which was of great importance for its scale and complication completed within 14.5 months and the commissioning of the electric carriage was celebrated as a great holiday on June 6, 1926.

Due to the acceleration of the development of other economic spheres aftyer the war especially in the 1960-1970s the volume of transportation of other cargoes also increased. The maximal volume of cargoes transported by the railway line is ascribed to 1987 at that time the railway accounted for 44.5 million tons of cargoes including 12.9 million tons of oil. The highest volume of oil and oil producted was transported in 1970. The cargo turnover by the Azeri railroads reached 43 billion tons in the 1980s.

Over the half of the railways that is 1126 kilometers were equipped with automatic block system, 479 kilometers with the centralized regulation and the remaining part with the semiautomated block system. The railway accounted for 176 stations two of them are the large automated grading stations of Biledjeti and Shirvan. 12 stations have container grounds equipped with necessary machines and mechanisms. 3 stations (Keshla, Ganja and Khyrdalan) are capable of operating large containers.

The state railway of Azerbaijan was one of the oldest iron highways of the former Soviet Union and the railwaymen of Azerbaijan overcame all the difficulties successfully during the Great Patriotic War. They supplied the Red Army with fuel and oil products and sent 1 million 300 thousand including 600 thousand cisterns load of fuel to the front.