a method of separating co 2 from a hydrocarbon gas inlet stream that is within predetermined pressure and temperature ranges , including the steps of subjecting the inlet stream to fractional distillation providing a co 2 bottom product stream and a distillation overhead stream , passing the distillation overhead stream to the inlet of a primary reflux drum producing a primary reflux liquid stream and a hydrocarbon vapor stream , subjecting the hydrocarbon vapor stream to membrane separation to provide a hydrocarbon product stream and a permeate stream , compressing the permeate stream and recycling the compressed permeate stream to the inlet of the primary reflux drum thereby providing a co 2 liquid product and a hydrocarbon gas product .