Ti–B–C nanocomposite films synthesized by magnetron sputtering are systematically studied with respect to the effect of composition and structure on their tribo-mechanical properties. The Ti–B–C films were deposited using a pilot-scale closed-field unbalanced magnetron sputtering system equipped with one graphite target, one TiB2 target, and two boron targets. The microstructure of the Ti–B–C films is represented by TiB2 nanocrystallites embedded in an amorphous boron carbide matrix. The film hardness varies in the range from 33 to 42GPa in relation to the composition and microstructure. The change in the mechanical properties depends upon the nanostructure, particularly the concentration and size of the TiB2 nanocrystallites in the amorphous boron carbide matrix. The tribological properties are closely related to the surface chemical states of the films. The lowest friction coefficient of 0.37 and the lowest wear rate of 3.3×10−6mm3/Nm are obtained for the Ti–B–C film with the highest titanium content, due to the formation of an oxide layer developed in the wear track. This layer acts as a solid lubricant during the tribological solicitation. The corrosion resistance of the M2 steel substrate is significantly enhanced by applying the Ti–B–C films, yielding a reduction of the corrosion current density by two orders of magnitude.