P-doped titanium dioxide (TiO2) nanoparticles were synthesized using a sol-gel method. The ethanol solution of Ti(OC2H5)4 was mixed with an aqueous solution of H3PO4 to undergo hydrolysis and polycondensation at 90 °C for 4 h. The resultant solids were centrifugally filtered, dried, and then calcined at different temperatures, followed by chemical and physical characterization. At an atomic ratio of P/Ti = 0.03, the formed P-doped TiO2 can preserve its anatase structure at 900 °C for 3 h, with no formation of other phases. Further increasing the P/Ti atomic ratio in the P-doped TiO2 may stabilize the anatase–TiO2 at even higher temperatures but may lead to the formation of TiP2O7 or (TiO)2P2O7. A test of photocatalysis showed that the P-doped TiO2 nanoparticles, with a P/Ti ratio = 0.03 and after being calcined at temperatures between 400 and 800 °C, can decompose ≥98 mol.% of the methylene blue (MB) after 30 min of irradiation by 365-nm ultraviolet light, while P25 particles can only decompose 71 mol% of the MB.