Metal–organic frameworks constructed by self-assembly of metal ions and organic linkers have recently been of great interest in the preparation of porous hybrid materials with a wide variety of functions. Despite much research in this area and the large choice of building blocks used to fine-tune pore size and structure, it remains a challenge to synthesise frameworks composed of polyamines to tailor the porosity and adsorption properties for CO2. Herein, we describe a rigid and microporous three-dimensional metal–organic framework with the formula [Zn2(L)(H2O)]Cl (L=1,4,7-tris(4-carboxybenzyl)-1,4,7-triazacyclononane) synthesised in a one-pot solvothermal reaction between zinc ions and a flexible cyclic polyaminocarboxylate. We have demonstrated, for the first time, that a porous rigid framework can be obtained by starting from a flexible amine building block. Sorption measurements revealed that the material exhibited a high surface area (1350 m2 g−1) and was the best compromise between capacity and selectivity for CO2 over CO, CH4, N2 and O2; as such it is a promising new selective adsorbent for CO2 capture.