SM31 class had been designed for shunting heavy freight trains in large freight stations, works and harbours. The design was elaborated in Fablok in 1973, mainly on the basis of SM42 locomotive. Production of this series lasted between 1976 and 1981, as well as between 1983 and 1985. In this period PKP bought 167 items of this series machines. A total number of ca. 200 locomotives was produced, with the rest of them servicing Polish industry, chiefly mining. Also first two prototypes (SM31-001 and SM31-002) were sold to industrial works, and the last one locomotive for PKP was re-bought from the industry (SM31-170).
As the main purpose of this series was shunting heavy freight trains, after its introduction PKP possessed shunters suited for all purposes. For extremely light trains mainly SM03 locomotives were used. Medium light trains were shunted by SM30 series, medium weight trains were left for SM42 engines. The last thing to be done was the introduction of heavy shunter able to work in severe climatic conditions, what did not happen before SM48 were brought to Poland.
SM31 is a Co-Co locomotive, what means it runs on two bogies, each equipped with three axles. Bogies are similar in construction to those used in SU45 and SU46 locomotives. This gives SM31 locomotive good performance on highland tracks. Being a typical shunter, SM31 has one crew compartment of the same height as machine and electric compartments. The engine (V8 compression-ignition engine) is in fact a developed version of SM42 locomotive engine, with its total power raised by ca. 50%. The engine propels main alternator, which gives power to six 196 kW traction motors.