With the rapid depletion of mineral phosphorus, the recovery of phosphorus from sewage sludge becomes increasingly important. However, the presence of various contaminants such as heavy metals in sewage sludge complicates the issue. One must separate phosphorus from the heavy metals in order to produce fertilizers of high quality. Among various available methods, nanofiltration (NF) has been demonstrated to be a feasible and promising option when the sewage sludge undergoes acidic dissolution and the operating pH is around 2. Because the performance of commercially available thin film composite (TFC) NF membranes reported thus far has great room for improvement, the development of highly permeable positively charged NF membranes is recommended. To this aim, a NF membrane that is desirable for phosphorus recovery was fabricated via interfacial polymerization of polyethylenimine (PEI) and trimesoyl chloride (TMC) on a porous poly(ether sulfone) (PES) membrane substrate. Through an optimization of the interfacial polymerization process, which involves varying the molecular weight of PEI and the concentration of TMC, the resultant membrane displays a low molecular weight cutoff (MWCO) of 170 Da with a reasonably high pure water permeability (A) of 6.4 LMH/bar. The newly developed NF membrane can effectively reject a wide variety of heavy metal ions such as Cu, Zn, Pb and Ni (>93%) while demonstrating a low phosphorus rejection of 19.6% at 10 bar using a feed solution of pH 2. Thus, up to 90% of the feed phosphorus may be recovered using this newly developed NF membrane at a permeate recovery of 90%. This is a highly competitive value for the recovery of phosphorus. © 2016 American Chemical Society.