A method and apparatus for purifying water are provided. A feed water such as seawater can be fed to a filter such as a nanofiltration membrane to produce a permeate that can, in turn, be fed to an electrodeionization system to produce fresh water.