The first railway in Lithuania opened in the 1860s between Daugavpils (in Latvia) and Vilnius. At that time, Lithuania was part of the Russian Empire, so the line was built to the Russian gauge of 1524mm (now 1520mm) in anticipation of its eventual connection with the rest of the Russian network.
During both the First and Second World Wars, Lithuania came under German occupation. Between the wars, it was an independent state but, after the Second World War, Lithuania again came within the Russian sphere of influence. It regained its independence on the dissolution of the Soviet Union.
During the First World War, the Germans regauged most of the main lines to standard (1435mm) gauge. However, unlike the situation in neighbouring Latvia, these remained standard gauge in the period between the wars. Only when Lithuania came under Soviet influence following the Second World War were all the main lines converted back to Russian gauge. For the most part, they retain this gauge today, although a few standard or dual gauge routes enter the country from Poland to facilitate the interchange of international freight traffic
Flag image from CIA World Factbook