In the current study, ultra-hard TiC, TiN, and Ti(C,N) layers were in-situ formed on carbon steel substrate using pure titanium electrode via electro-spark deposition (ESD) in argon, nitrogen, argon/nitrogen, and air atmospheres. The synthesized coatings were characterized using various techniques, including FE-SEM/EDS, X-ray diffractometry, Raman spectroscopy, microhardness and nanoindentation tests, and surface roughness measurement. Also, a thermodynamic simulation was executed to estimate the phase-stability. Fe5C2, TiN, Fe3N, and Ti2O3 were determined as the major phases formed under the argon, nitrogen, Ar/N2, and air atmospheres, respectively. The formation of martensite at the interface of the coating and substrate in all atmospheres indicates the capability of the ESD process for surface hardening. The observed discrepancies between the empirically formed phases and the thermodynamics prediction can be related to the non-equilibrium conditions of the ESD process. It was revealed that gaseous media such as argon and nitrogen serve as a protective/active environment in the titanium/steel system. It is proposed that the electro-sparking of titanium under the active nitrogen medium follows an avalanche plasma regime. Under the argon flow, FeTi intermetallic layer is formed. Whilst, electro-sparking in ambient air leads to the formation of various Fe-Ti-O compounds, as well as different TiOn oxides. On the other hand, the utilization of nitrogen gas during the ESD increases the surface roughness and the thickness of the coating, rather than the deposition under the argon flow, due to the extra heat of reactions. The dynamic reactions occur between pure titanium, nitrogen, carbon, and oxygen, leading to the initial formation of Ti(C,N) at the top surface, followed by the production of titanium oxides in the middle layer. The coexistence of the super-hard Ti(C,N) with a hardness of 3130 HV at the top surface and titanium nitrides beneath it in a gradient mode effectively impedes the crack propagation.