Two Mg-based metal-organic frameworks (MOFs) were prepared using a coordination competition strategy. Under acidic conditions, the reaction of Mg(II) ions with formic acid generated from the thermal decomposition of N, N-dimethylformamide (DMF) formed a 3D formate Mg-MOF: [Mg-3(HCO2)(6)] center dot DMF (1). However, under the same conditions but with a competing ligand 1,1 ':3 ',1 ''-terphenyl-3,3 '',5,5 ''-tetracarboxylic acid (H4L), formic acid was no longer involved in the coordination, resulting in a new 3D Mg-MOF: [Mg-2(L)(H2O)(3)] center dot 2H(2)O center dot 2CH(3)CN center dot DMF (2). Single-crystal X-ray analysis revealed that 1 possesses [Mg-4@Mg-2] tetrahedral building units that form a dia topological network with a 1D channel size of 0.44 nm. In contrast, 2 has a unique [Mg-2] binuclear cluster to build a sra topology network after bridging the 4-connected L4- linker. Interestingly, a dumbbell-shaped pore with a length of 1.42 nm is observed along the a-axis in 2. Gas adsorption studies reveal that 1 had a significantly accessible inner surface with a surface area of 342 m(2)center dot g(-1). However, after solvent removal, 2 could not retain the original porous character. Featuring good water stability, 1 exhibited a type-I CO2 adsorption isotherm with quick uptake at low pressure, and up to 14.5% of the sample weight at 298 K and 2 000 kPa. Ideal adsorption solution theory (IAST) and adsorption heat calculations show that 1 has a good ability for selective CO2 capture from CH4 contained mixture. CCDC: 2194650, 1; 2202252, 2.