Rail transport in Azerbaijan
Rail transport in Azerbaijan is operated by the national state-owned railway company Azerbaijan Railways (). The railway network consists of , its gauge is  (Russian broad gauge),  are double track and  are electrified at 3 kV (3,000 V) DC. Azerbaijan's location and infrastructure have contributed to the vibrant transport sector of the country. Railways take up 16.7% of Azerbaijan's freight traffic flows. Throughout 2005–2009, a massive railway modernisation programme was initiated. Expansions costing $795 million were announced in 2012 to respond to the growing demand for rail transport in the country. Also Stadler Rail and local partner International Railway Distribution LLC announced the formation of a 51:49 joint venture on July 17, 2014. History

Russian Imperial Railways 1878–1917 

The first railway line in Azerbaijan then belonging to the Russian Empire was laid in 1878 and was opened in 1880 within the suburban range of Baku, which led from Sabunçu to Suraxanı, today situated within the city of Baku. The track width corresponded to the Russian  gauge. The first long-distance railway line was opened in 1883, which led from Baku to Tbilisi in Georgia. In 1900 railway lines were opened which connected Baku via Biləcəri with Derbent and Petrovsk (Makhachkala) in Dagestan and thus connected Azerbaijan with the rest of the Russian Empire (and later the Soviet Union). In 1908 with an extension of the railway line from Ararat in Armenia to Şərur and Julfa in the Nakhchivan exclave of Azerbaijan, this part of Azerbaijan was connected with Armenia. Thus the development of the Azerbaijani Railway was for the time being considered final. Soviet Railways 1917–1991 
After the collapse of the Russian Empire and the Russian Revolution, the country was transformed into the Soviet Union and the Russian Imperial Railways into the Soviet Railways. Due to the availability of electricity from the vast water power sources of Azerbaijan, the very early electrification of the railway lines of Azerbaijan began. In 1926 with the electrification with 1.2 kV (1,200 V) direct current of the railway line between Baku and Sabunçu, it became the first electrically operated railway line of the Soviet Union. Later electrifications took place with 3 kV (3,000 V) direct current. In 1924 the railway line was extended southwards to Ələt and Neftçala. In 1941 the railway line was extended from Horadiz and Mincivan through Armenia including a railway line extension to Kapan, to Julfa in the Nakhchivan exclave of Azerbaijan. Thus the Nakhchivan exclave of Azerbaijan was finally connected with Azerbaijan proper. In 1941 the railway line was also extended southwards to Astara, Azerbaijan at the southern border with Iran. In 1944 the railway line was extended to Kətəlparaq, Ağdam and Stepanakert (Xankəndi). Until 1991 the railway traffic was operated in Azerbaijan by the Soviet Railway under the supervision of the Soviet Traffic Ministry. The Azerbaijani branch of the Soviet Railways was divided into three departments of Baku, Gəncə and Nakhchivan City. Azerbaijan Railways (Azərbaycan Dəmir Yolları) 1991– 

With the independence of the Republic of Azerbaijan in 1991, the Azerbaijan State Railways (Azərbaycan Dövlət Dəmir Yolları) was formed the same year. Azerbaijan Railways CJSC 

Azerbaijan Railways Closed Joint Stock Company was established by a reorganisation of the Azerbaijan State Railway in 2009. The Company includes Transportation Processes Management Union, Passenger Transportation Production Union, Locomotive Production Union, Carriage Service Production Union, Road Production Union, Power Supply Production Union, Indication and Communication Production Union, Militarised Enforcement Organization, Nakhchivan Department and other enterprises. The international network serves Russia (Baku–Moscow, Baku–Saint-Petersburg, Baku–Rostow, Baku–Tumen, Baku–Mahachkala), Ukraine (Babu–Kiev, Baku–Xorkov), Georgia (Baku–Tbilisi). Domestic routes are Baku–Kocherli–Balaken, Baku–Astara–Horadiz, Baku–Kazakh–Boyuk Kesik, Baku–Agstafa, Baku–Gandja, Baku–Mingechevir, and Baku–Astara routes. Network

So far 2,932 km of rail tracks including 2,117 km of carrier service lines, 810 km of industrial lines have been laid in Azerbaijan. In 1988, during the Nagorno-Karabakh conflict, territories of Azerbaijan with 240 km of rail tracks were occupied by Armenia. The railway link connecting the city Nakhchivan of Azerbaijan with other Azerbaijani regions was broken in 1991. Azerbaijan Railways serves 176 stations. 2 of them (Bilajari and Shirvan) are completely automated. 12 stations have container yards. Keshle, Ganja and Khirdalan stations are able to supply high cube cargo containers. 1,272 km of the total railway routes are electrified at 3 kV (3,000 V) DC. 1,126 km of railway roads are supplied with full automatic blocks. Just 479 km of railway links are provided with centralized dispatchers. There are no high-speed trains in Azerbaijan. Rail links to adjacent countries

 Russia: there is a direct Moscow–Baku train which runs 3 times weekly. The train passes through Volgograd, Astrakhan, and Makhachkala, and takes 3 nights. There are also direct trains from some other towns in Russia to Baku. Iran: construction of the Astara (Iran) - Astara (Azerbaijan) railway is due to be completed in 2021. The Gazvin-Rasht-Astara railway route will integrate the national rail networks of Azerbaijan, Iran, and Russia. Azerbaijan allocated a preferential loan of $500 million for the construction of the line. Turkey: the Baku–Tbilisi–Kars railway, connecting Turkey, Georgia, and Azerbaijan, began operating in 2017. Urban railways

Metro
Baku is the only city with a metro system, the Baku Metro. Plans to expand the metro are under way, with additional subway systems to be constructed in Azerbaijan's most populated and developed cities. Construction of the Baku Metro system was commenced in 1951 and completed in 1967. Its opening ceremony was held on November 6, 1967, with the first stretch, 6.5 km long between Baki Soveti and Narimanov. Presently Baku metro system has a total track length of 40.70 km, with 27 stations on three lines:
 Red line, 32.3 km with 21 stations, an electrical depot
 Green Line, 2.2 km with 2 stations,
 Purple Line, 6.1 km with 4 stations, an electrical depot, administrative building. The platform length in the stations is 105 m. The platforms allow the use of 5-car trains. Newly opened Purple Line stations are designed with platforms that allow the use of 7-car trains. Stations 

The fare of metro service is 0.40 AZN. It is carried out only by "BakiKart" plastic cards. Commuter
In 2019 the Baku suburban railway was launched. . Freight services 

Azerbaijan is positioning itself as a transportation hub for east–west, north–south for freight trade in the region. Baku–Tbilisi–Kars 

The Baku–Tbilisi–Kars rail link, with a capacity to transport 1 million passengers and 5 million tons of freight a year, connects 3 countries (Azerbaijan, Georgia, and Turkey). At the same time, it is a main freight and passenger link between Europe and China. The BTK Railway will also connect Turkmenistan and Kazakhstan to continental Europe. Negotiations on the Baku–Tbilisi–Kars railway began in 2005. In 2007 the construction of the railway was commenced. The importance of the project is offering the most cost-effective transportation for the logistics sector that seeks a more economical way of delivering goods to target markets. Initially, the railway will carry nearly 1 million passengers and 6.5 million tons of freight a year. But in the near future freight transportation potential will be up to 50 million tons a year. On October 30, 2017, an inauguration ceremony for the Baku–Tbilisi–Kars (BTK) railroad was held in Alyat,  southwest of Baku. The European Union called the opening of the railway "a major step in transport interconnections linking the European Union, Turkey, Georgia, Azerbaijan, and Central Asia". Approximately  of the BTK railway passes through Azerbaijan, with  through Georgia and  through Turkey. The North–South Corridor 

The North–South corridor, with a length of , is designed to carry more than 20 million tons per year from India, Iran and other Persian Gulf countries to the territory of Russia (the Caspian Sea) and further on to Northern and Western Europe. The agreement among Russia, Iran, and India on the North–South International Transport Corridor was signed in Saint Petersburg (Russia) in September 2000. Azerbaijan joined the project in 2005. Through the North–South Corridor route, Northern Europe and Southeast Asia will be connected. Presently Iran carries out construction work on completion of the missing link of the Qazvin–Rasht–Astara road and railway () including the Rasht–Astara section (). of bridges and railway lines to link the southern sections to the northern ones will be constructed within the framework of the project. The Rasht–Astara section of the North–South Corridor route was completed in 2016. The remaining construction of the Qazvin to Rasht rail route is nearing completion. The current sea route via the frontiers of Western Europe, through the Mediterranean and the Suez Canal, takes 40 days. The North–South Corridor will reduce transport time by half. According to the project, the goods that will be transported via the corridor from India to Russia and Europe will be delivered in 12 days. The annual transit through Azerbaijan will consist of millions of tonnes of freight. 