A series of sulfonated copolyimides containing pyrimidine groups (SPIs) were synthesized by random copolymerization of 1,4,5,8‐naphthalenetetracarboxylic dianhydride (NTDA), 2‐(4‐aminophenyl)‐5‐aminopyrimidine (PAPRM), and 4,4′‐diaminodiphenyl ether‐2,2′‐disulfonic acid (ODADS). Proton exchange treatment in 1.0 M sulfuric acid solution resulted in ionic cross‐linking of the sulfonated copolymers due to the acid (sulfonic acid)‐base (pyrimidine group) interactions and the membrane with more basic PAPRM moiety could absorb sulfuric acid to favor the proton transfer. The effects of the structure of the diamines on the properties of SPI membranes were evaluated by studying the membrane parameters including water uptake, proton conductivity, water stability, and methanol permeability. The basic pyrimidine groups introduced in the main chains could effectively resist membrane swelling due to the strong interchain interactions through basic pyrimidine groups and sulfonic acid groups. Compared with the corresponding uncross‐linked copolyimides (NTDA/ODADS/ODA), the acid–base copolyimides displayed excellent water stability. The SPI membranes also exhibited improved mechanical properties and decreased methanol permeability. However, the cross‐linked membranes showed lowered proton conductivities than the uncross‐linked ones because a small part of the sulfonic acid groups had been consumed during the cross‐linking process. Copyright © 2010 John Wiley & Sons, Ltd.