In an attempt to improve the mechanical and thermal properties of poly(ionic liquid)s (PILs), a new synthetic method for the modification of polyimides is reported here for the first time. The proposed methodology consists of the transformation of polyimides into their ionic forms via subsequent N-alkylation and quaternization of benzimidazole or quinuclidine moieties. Finally, an ion exchange reaction was also carried out in order to prepare polymers bearing the bis(trifluoromethylsulfonyl)imide anion. The elaboration of optimal conditions for the reactions afforded the preparation of high molecular weight (Mn = 2.2-9.7 × 104) cationic polyelectrolytes with a degree of quaternization as high as 96%. Among the unique features of these new PILs are the preservation of excellent mechanical and thermal properties inherent in polyimides, the adjustable surface wettability with variable water contact angles from 70.5 to 94.3°, the enhanced hydrolytic stability (up to 9 h in boiling water) and improved gas transport properties (CO2 permeability up to 28.9 Barrer for a neat film and 85.0 Barrer for a filled membrane at 20 °C and 100 kPa).