The inherent resiliency, hardness and relatively low friction coefficient of the fullerene-like (FL) allotrope of carbon nitride (CNx) thin solid films give them potential in numerous tribological applications. In this work, we study the substitution of N with P to grow FL-CPx to achieve better cross- and inter-linking of the graphene planes, improving thus the material’s mechanical and tribological properties. The CNx and CPx films have been synthesized by DC magnetron sputtering. HRTEM have shown the CPx films exhibit a short range ordered structure with FL characteristics for substrate temperature of 300 °C and for a phosphorus content of 10-15 at.%. These films show better mechanical properties in terms of hardness and resiliency compared to those of the FL-CNx films. The low water adsorption of the films is correlated to the theoretical prediction for low density of dangling bonds in both, CNx and CPx. First-principles calculations based on Density Functional Theory (DFT) were performed to provide additional insight on the structure and bonding in CNx, CPx, and a-C compounds.