The locomotive WLs40 was designed in Fablok state-owned factory in Chrzanów in 1950, basing upon a pre-war industrial locomotive 1DK, built under German Deutz AG licence. Only two low-profile 1DK locomotives were manufactured in 1932, for underground coal mine service on 580 mm gauge tracks. Facing a shortage of industrial locomotives in the country ruined after World War II, Fablok adapted its design, fitting bigger cab at the rear and Polish-designed 40 hp S-64L four-cylinder Diesel engine (maximum power output was 44 hp). It was driving two axles by a four-gear L8 mechanical transmission (developed from Deutz design), a jackshaft, connecting rods and coupling rods. The locomotive entered series production with a factory designation WLs40, which stood for Wąskotorowa - narrow-gauge, Lokomotywa - locomotive, spalinowa - internal combustion engine of 40 hp.
A prototype was built in 1951 at state-owned Warsaw Industrial Equipment Manufacturing Works in Warsaw (Warszawskie Zakłady Budowy Urządzeń Przemysłowych, WZBUP), possibly followed by several dozens of locomotives. Then the authorities of centrally-planned industry decided to move the production to Rolling Stock Repair Works (Zakłady Naprawcze Taboru Kolejowego, ZNTK) in Poznań. According to some sources, from 1952, 883 WLs40 were built there.
From 1958, an improved WLs50 version was also produced, differing in newer 50 hp S-324HL Diesel engine. Maximum output was
54 hp. It replaced WLs40 in production by late 1960s. It is assumed, that 1090 locomotives WLs50 were built until 1975. However, due to lacks and errors in documents, numbers of manufactured WLs40 and WLs50 locomotives are not certain, and they might also cover 2WLs40/50 locomotives.
A small number of locomotives were made for other gauges, according to specific needs, like 520 mm, 550 mm, 630 mm, 640 mm, 700 mm.
Related design, with the same engines and transmission, were enlarged 2WLs40 and 2WLs50 locomotives, for 750 mm, 785 mm and 900 mm gauges. 47 of 2WLs40 and 153 of 2WLs50 were built in Poznań. These locomotives, however, were usually marked just as WLs40/50 as well, which may cause a confusion in documents. Its standard-gauge counterpart was yet bigger Ls40 locomotive, with the same components.