A MgII complex containing malonate as the primary ligand and 4-aminopyridine as the secondary ligand (counter ion), namely (ampyH)2[Mg(mal)2(H2O)2] (1; ampyH = protonated 4-aminopyridine, malH2 = malonic acid), has been synthesized from purely aqueous media just by mixing the reactants in their stoichiometric proportions. Its crystal structure was determined by single-crystal X-ray diffraction. In 1, monomeric metal malonate units [Mg(mal)2(H2O)2]2– are interlinked through hydrogen bonds to generate infinite 2D supramolecular sheets. These supramolecular sheets are bridged by 4-aminopyridine molecules to generate a 3D structure. Similar complexes containing 4-aminopyridine as the secondary ligand (counter ion) show an identical self-assembly process, except for the copper analogue, which was found to be polymeric in nature. By means of DFT theoretical calculations (BP86-D3/def2-TZVPD), we provide a plausible explanation for this different behaviour and present an energetic analysis of the complexes. The Hirshfeld surfaces of the Mg structure and related Cu, Ni and Co structures were analyzed to clarify the nature of the intermolecular interactions.