We synthesized a unique layer structure of gallium phosphates containing zwitterionic-type templates under mild hydrothermal reactions. The zwitterionic-type templates, formed of long-alkyl-chain diamine cations and biphenyldicarboxylate anions, resided upright between adjacent layers, propping the interlayer distance up to 2.2 nm. For the first time, the mesoscale interlayer templates were sufficiently well-ordered to afford elucidation to the atomic-level. The mesolamellar (HDADD)2(BPDC)0.5[Ga3(OH)2(HPO4)4] (1; DADD = 1,12-diaminododecane, BPDC = 4,4'-biphenyldicarboxylate) was composed of inorganic layers built up exclusively with a unique type of heptameric unit which featured an unprecedented trimeric cluster of [Ga3(OH)2O12]. Unexpectedly, compound 1 possessed an unusual green afterglow. To interpret the interesting photoluminescence (PL) property, three other low-dimensional structures related to 1 were prepared as well. The data from PL and electron paramagnetic resonance indicated that the afterglow was mainly attributed to lattice defects and the orientations of BPDC.