Membrane technology has the potential to replace thermal methods for gas separation, resulting in significant energy savings. However, materials with better combinations of permeability and selectivity are needed to fulfill industrial requirements. In this work, we functionalize a polymer of intrinsic microporosity with a high CO 2 affinity guanidinium moiety to produce a highly CO 2 -permselective ionic polymer (PIM-G). Permeability−selectivity performance is compared under pure-and mixed-gas conditions for CO 2 /CH 4 , CO 2 /N 2 , and CO 2 /O 2 gas pairs. In addition, counteranion identities are modified along the halide series (F − , Cl − , Br − , and I − ) to optimize separation performance, with larger halides found to improve the CO 2 permselectivity without a commensurate drop in the CO 2 permeability.