A family of open-framework gallium phosphates (GaPOs), namely [dmdabco](0.5)[Ga(HPO4)(2)] (1, dmdabco = N,N'-dimethyl-1,4-diazabicyclo[2,2,2]octane), [tmpip](0.5)[Ga-3(OH)(PO4)(3)]center dot(H2O)(0.25) (2, tmpip = N,N,N',N'-tetramethyl-piperazinium), [mpy][Ga3F(PO4)(3)]center dot(H2O)(0.25) (3, mpy = N-methyl-pyridine), [dmbpy](0.5)[Ga-2(HPO4)(2)(PO4)] (4, dmbpy = N,N'-dimethyl-4,4 '-bipyridine), and [Hmpip](2)[Ga-7(OH)(PO4)(6)(HPO4)(2)] (5, mpip = N-methylpiperazine) have been fabricated under hydro(solvo)thermal conditions and structurally characterized. The in situ-template-synthesis strategy is firstly used to construct the gallium phosphates. The in situ generated dmdabco(2+), tmpip(2+), mpy(+) and dmbpy(2+) templates were derived from the methylation of two distinct types of organic-amine precursors under methanol media: aliphatic 1,4-diazabicyclo[2,2,2]octane (dabco) in 1, 1,4-dimethylpiperazine or 1-methylpiperazine or piperazine (pip) in 2, and aromatic pyridine (py) in 3 and 4,4 '-bipyridine (bpy) in 4. Such a unique in situ methylation feature is different from classic Eschweiler-Clarke methylation in which excessive formic acid and formaldehyde is needed. Compound 1 exhibits infinite inorganic chains connected by hydrogen bonds to generate a 3D supramolecular framework; compounds 2 and 3 are isomorphous and constructed from a Ga6P6 secondary building unit (SBUs), forming a 3D pcu architecture with intersecting 8-membered channels; compound 4 possesses an inorganic layered structure and compound 5 features an interesting 3D open-framework architecture with helical channels.