The first railway in present day Lebanon opened when the territory was part of the Ottoman Empire. The line from the major port city of Beirut to Damascus in present day Syria opened in 1895. It was built to the unusual gauge of 1050 mm.
A second line opened in 1906; it connected with the first line at Rayak (Riyaq) and ran to Aleppo in present day Syria. However, it was built to standard (1435 mm) gauge, so transhipment was required at Rayak. 5 years later, a branch opened from the latter line to the Lebanese port of Tripoli. The junction was at Homs in present day Syria, so that when the borders of Lebanon were defined (first as an autonomous region of French mandated Syria and later as an independent country) the Tripoli line was isolated from the rest of the system.
During the Second World War, Allied forces extended the Tripoli line southwards along the coast, via Beirut, to Israel, forming part of a through rail route from Turkey to North Africa. At the conclusion of hostilities, the Lebanese section of this line was purchased by the government. Deteriorating Arab - Israeli relations meant that the cross-border link with Israel was soon severed, with the southern coastal line then terminating at Naqoura.
The network remained in this form until the Civil War of the 1970s, which almost completely destroyed the infrastructure. One section of line, between Beirut and Chekka, remained open for movements of cement trains until 1997, since when there have been no train movements.
There have been various proposals to reinstate all or part of the Lebanese rail system, but to date no progress been made.
Flag image from CIA World Factbook