A multicompartment photoelectrodialytic demineralization cell is provided with a buffer compartment interposed between the product compartment and a compartment containing an electrolyte solution. Semipermeable membranes separate the buffer compartment from the product and electrolyte compartments. The buffer compartment is flushed to prevent leakage of the electrolyte compartment from entering the product compartment.