Two alkaline-earth coordination compounds, [Ba(C8H4N4O2)(H2O)4]
n
, (I), and [Sr(C8H4N4O2)(H2O)3]
n
, (II), from the one-pot hydrolysis transformation of benzoyl chloride and the in situ self-assembled [2 + 3] cycloaddition of nitrile are presented. These coordination compounds are prepared by reacting 4-cyanobenzoyl chloride with divalent alkaline-earth salts (BaCl2 and SrCl2) in aqueous solution under hydrothermal conditions. The mononuclear coordination compounds (I) and (II) show the same mode of coordination of the organic ligands. The cohesion of the crystalline structures is provided by hydrogen bonds and π-stacking interactions, thus forming three-dimensional supramolecular networks. The two compounds have a three-dimensional (3,6)-connected topology, and the structural differences between them is in the number of water molecules around the alkaline earth metals. Having the same emission frequencies, the compounds exhibit photoluminescence properties with a downward absorption value from (I) to (II).