Phosphorus-doped carbon materials are a promising candidate for energy storage devices, water splitting, molecular sensing, spin filtering, and optical quantum computers. We investigated the incorporation of phosphorus in pristine and defected graphene nanoribbons (GNRs) using first-principles density functional theory calculations. We analyzed how P-doping and P-functionalities modify the structure and electronic and magnetic properties of GNRs having armchair (AGNRs) and zigzag (ZGNRs) edges. The functional groups were anchored at the edges of the GNRs. The results were analyzed for band structure, the density of states, charge transfer, wave functions, spin density, oxidation energies, and protonation energies. Our findings revealed that the incorporation of phosphorous into the graphitic structures promotes p-type doping. P-doping and P-functionalization in graphene nanoribbons induced a bandgap reduction. Metallic behavior was found for phosphole-like doping (P in a pentagonal ring), P-2vac configuration (P replacing two vacancies), phosphoramide, and phosphorus-dithiolate. The magnetic properties of ZGNRs were strongly influenced by phosphorus doping and functionalization. Usually, the P-doping in ZGNRs promotes a ferromagnetic ground state with aligned spins at the edges and a total magnetization ranging in 3.18–3.90 μB. AGNRs functionalized with phosphate, phosphite, and phosphorodithiolate groups exhibited a ferromagnetic ground state with magnetic moments localized at the functional groups with a total magnetization of 1.03–1.33 μB. The energetic stability of the magnetic properties is discussed. From protonation and oxidation energy calculations, Phosphorus-doping edges (phosphole-like and phosphine-like) are more susceptible to trap H or O atoms. The ribbon width dependence of the total magnetization and protonation energy for phosphate and phosphite functional groups are also discussed. The results obtained from this investigation provide a theoretical basis for better understanding experimental evidence of ferromagnetism in phosphorus-doped graphene and chemical activity of phosphorus-doped graphitic materials. Our investigations propose possible scenarios on the magnetism source in recent experimental findings on ferromagnetism in P-doped graphene and provide a theoretical basis to understand the phosphorus further into graphitic materials.