Highly permeable and selective membranes with long-term stability are needed to reduce operating and capital costs of industrial gas-separation units. In this study, we fabricate new membranes made of melamine (M)- and imidazolium-based ionic liquid (IL)-modified graphene oxide (GO) deposited on a porous support and buried with a polydimethylsiloxane (PDMS) layer. The CO2/N2 and CO2/CH4 ideal selectivities of the composite membranes are respectively 65 % and 70 % higher than those of the membranes containing only the IL. This significant improvement in ideal selectivity is attributed to synergic effects of nanochannels created by GO, fixed facilitated transport provided by the IL and numerous amine groups in the melamine structure, and the increased polarity of the membrane caused by the presence of the IL. The composite membrane has a pure CO2 permeance of 47 GPU with a high CO2/N2 ideal selectivity of 109 and a satisfactory CO2/CH4 ideal selectivity of 39. The composite membrane maintains stable performance over a 60-hour operation, highlighting its long-term reliability. The outstanding performance, coupled with the ease of fabrication, underscores the potential of these composite membranes for practical and efficient CO2 removal from both natural and flue gas streams in real-world applications.