The films in Ti-B-C system have been deposited onto Si (100) substrates by dual direct current magnetron sputtering of Ti-B and graphite targets. During deposition, the sputtering parameters at the Ti-B target were unchanged, and the carbon content in films was controlled by variation of sputtering current at the graphite target in the range of 0-250 mA. The films were characterized in terms of their structure, composition, and mechanical properties. The X-ray diffraction measurements showed that all the films contain only one TiB2 crystalline phase of prominent (001) and (002) textures.The film hardness first increased with the increased carbon content due to the reduced grain size reaching maximum value of about 51.5 GPa for films deposited with 200 mA sputtering current, and then it is started to decrease due to the increased content of a softer amorphous phase. The friction coefficient steadily decreased with increasing film hardness. First-principles calculations together with the experimental results have made it possible to assume that the deposited Ti-B-C films consist of nanocrystals of solid solution TiB2-xCx surrounded by amorphous B-C-O phase.