The title compound, 2C3H7N6
+·C6H7NO6
2−·3H2O, was obtained by mixing melamine and nitrilotriacetic acid in aqueous solution. There is proton transfer from the nitrilotriacteic acid to melamine to produce two melaminium cations and an internal proton transfer to generate the [HN(CH2COO)]2− zwitterion. The melaminium cations are arranged in hydrogen-bonded tapes formed by N—H⋯N interactions. These tapes extend parallel to the [010] direction and are stacked parallel to the a axis at a mean separation of 3.3559 (11) Å. Between these tapes lie the anions and lattice water molecules. Further O—H⋯O and N—H⋯O hydrogen bonds exist between the water molecules, the anions, and the melaminium cations, generating a three-dimensional array. The crystal examined was found to be twinned by a twofold rotation about the direct lattice direction [100]. The two twin components were present in the ratio 0.5918:0.4082 (14).