The Berlin–Wrocław railway (German: Niederschlesisch-Märkische Eisenbahn-Gesellschaft, roughly translating as "Lower Silesian-Marcher Railway", NME) was a German private railway that connected Berlin (then capital of the March of Brandenburg, Mark Brandenburg) and Wrocław (in Lower Silesia, then part of Prussia, and called Breslau in German, now in Poland). It is one of the oldest lines in Germany, opened between 1842 and 1847 and acquired by the Prussian government in 1852. In 1920, it became part of the German national railways along with the rest of the Prussian state railways.
Around 1840 all the major countries of the German Confederation began the build main-line railways. From 1837 to 1839, the first German long-distance railway was built in Saxony, the Leipzig–Dresden railway. In 1837 Austria began building its Northern Railway. From 1838 to 1840 the first railways crossing state boundaries (the Magdeburg–Leipzig railway and the Anhalt Railway) were built. More Prussian railway projects soon followed. Thus the Berlin-Frankfurt Railway Company (Berlin-Frankfurter Eisenbahn-Gesellschaft) built an 81 kilometre-long railway between Berlin and Frankfurt (Oder) between 1840 and 1842 and opened it on 23 October 1842. It ran from the Frankfurter Bahnhof (Frankfurt station), later called the Schlesischer Bahnhof, (Silesian Station) in Berlin via Fürstenwalde to Frankfurt (Oder).
In the same year the Lower Silesian-Mark Railway Company (Niederschlesisch-Märkische Eisenbahn-Gesellschaft, NME) was established with the Prussian government participation to build a railway from Berlin to Breslau (Wrocław), then the second largest city in Prussia, where construction of the Upper Silesian Railway (Oberschlesische Eisenbahn) had already started.
The NME completed the first section between Wrocław and Legnica (Liegnitz) on 19 October 1844 before the full route of the line had been determined. A year later, on 1 October 1845, the section to Boleslawiec (Bunzlau) was opened.
On 1 August 1845 the Berlin-Frankfurt Railway Company's shareholders agreed to merge with the NME. The continuation of the NME’s line through Węgliniec (Kohlfurt), Żary (Sorau) and Guben to Frankfurt an der Oder was completed on 1 September 1846, so that the railway extended from Wrocław to Berlin, a total distance of 357 km. The Upper Silesian Railway's network at that time already extended from Wroclaw to Racibórz (Ratibor).
On 1 September 1847 the NME's branch from Węgliniec to Görlitz and the eastern section of the Saxon-Silesian line between Reichenbach and Görlitz were both opened. This formed a continuous rail link from Wrocław via Dresden, Leipzig, Magdeburg, Oschersleben, Wolfenbüttel and Brunswick to Hanover. Six weeks later, on 15 October 1847, the opening of the Hanover–Minden line and the Hamm–Minden line created a continuous link to Deutz on the banks of the Rhine opposite Cologne, which was linked to the Western European railway network via the Rhenish Railway’s line to Aachen. With the opening of a connecting line between the Wrocław stations on 3 February 1848 it was connected to the Upper Silesian Railway (completed on 18 October 1847) and the Kraków–Upper Silesian railway (completed on 13 October 1847), creating a continuous rail link from Deutz to Kraków. Less than a year later on 1 September 1848, the William's Railway (Wilhelmsbahn) was opened from Koźle (Cosel) to Bohumín (now in the Czech Republic, then in the Austrian Empire), closing the gap between the Upper Silesian Railway and the Austrian Northern Railway, which had opened to Bohumín on 1 April 1847. This created a continuous rail link between Berlin and Vienna.