Most commercial nanofiltration (NF) membranes carry negative charges, which is unfavorable for rejecting positively charged impurities according to the Donnan effect. Two ionic liquids (ILs) with the same cation, namely 1-aminopropylimidazolium hexafluorophosphate ([C3NH2MIm]PF6) and 1-aminopropyl-3-methylimidazolium bromide ([C3NH2MIm]Br), were employed to improve membrane surface charge by surface modification. With the ILs regulating the membrane structure, the resultant membranes (IL-PA) displayed a rough surface with higher hydrophilicity, larger pores, enhanced surface charge and structure stability than the blank PA membrane. Specifically, with IL concentration increasing, the [C3NH2MIm]PF6 modified (PF6/PA) membranes showed enhanced isoelectric point (IEP) from 4.5 to 6.5, while that of the Br/PA membranes was decreased from 3.7 to 3.1. It indicates the anionic part of ILs determined its distribution in the PA layer. High Po/w of [C3NH2MIm]PF6 enabled high diffusivity in the PA layer, and thus, more [C3NH2MIm]+ grafted on the membrane surface, leading to high IEP and contact angle. Overall, the optimized 0.5PF6/PA membrane exhibited a high pure water flux of 62.2 L·m−2·h−1 and enhanced heavy metal removal efficiency (Cu2+ 97.1 %, Ni2+ 94.6 %, Cd2+ 95.5 %, Zn2+ 96.4 %). This work demonstrates the feasibility of specific functionalized ILs in heavy metal wastewater treatment.