The level of CO2 in the atmosphere has increased rapidly due to vast quantities of fossil fuel combustion emissions, and it is accelerating global warming. Hence, pre- and post-combustion CO2 capture and storage (CCS) has become a vital necessity. Cost-effective and efficient nanoporous adsorbents for pre- and post-combustion CO2 capture were developed in this study. The highly porous and oxygen-rich carbon adsorbents were prepared in a facile one-pot process via the direct chemical activation of a molecularly imprinted polymer (MIP) and a MIP composite with activated carbon. The porous carbon adsorbent prepared from the MIP composite had a large specific surface area and specific pore volume of 3010 m2 g-1 and 1.506 cm3 g-1, respectively. Its bimodal pore structure contained micropores and mesopores. This nanoporous carbon adsorbent was rich in electrondense oxygen presented in a variety of oxygen surface functional groups, which was also advantageous for CCS. These merits afforded selective CO2 adsorption and a high storage capacity under pre- and post-combustion conditions. The efficient carbon adsorbent can be stored 22.1 mmol g-1 and 3 mmol g-1 of CO2 at 25 bar and 1 bar, respectably, which was in the upper range of values reported for porous carbon. Selective CO2 capture by the carbon adsorbents was confirmed by evaluating their selectivity in CO2/CH4, CO2/N2, and CO2/H2 binary gas mixtures at 298 K based on the ideal adsorbed solution theory (IAST). The most effective adsorbent had CO2/H2 (40:60) and CO2/N2 (50:50) selectivity of 534 and 22.6, respectively. The isosteric heat of CO2 adsorption on the porous carbon adsorbents further corroborated the selective CO2 capture.