NOVELTY - Nitrogen from a gas stream containing methane and at least4% nitrogen is removed by using a two-step membrane system design, and controlling the operating parameters for the membrane steps within certain ranges.    USE - For removing nitrogen from a gas stream comprising methane and at least4% nitrogen.    ADVANTAGE - The inventive process is simple, reliable and cost-effective, and is able to meet natural gas pipeline specifications for nitrogen in a cost-effective manner. It relies on membrane separation using methane-selective membranes, but does not require the membranes to be operated at very low temperatures. It enhances reliability and acceptability in the field, and can result in cost and energy savings. It greatly simplifies the process compared with prior art technologies. It can be carried out, if desired, with little or no pretreatment of the incoming raw natural gas compared to cryogenic separation and previous membrane separation processes. It obtains with an acceptably small methane loss. Methane recovery is normally at least70%, and is typically much higher, e.g. at least80 or 90%. By using a two-step membrane system design and controlling the operating pressures for the membrane steps within certain ranges, the capital and operating costs of the process can be kept within economically acceptable limits.    DETAILED DESCRIPTION - Removal of nitrogen from a gas stream comprising methane and at least4% nitrogen, includes (a) compressing the gas stream to a first pressure of 400-1500 psia to form a compressed gas stream; (b) providing a first membrane unit containing a first membrane having a first feed side and a first permeate side; (c) providing a second membrane unit containing a second membrane having a second feed side and a second permeate side; (d) introducing the compressed gas stream at a first temperature higher than -40degreesC into the first membrane unit at a first inlet of the first feed side, and passing the compressed gas stream across the first feed side; (e) withdrawing from a first outlet of the first feed side a first residue mixture enriched in nitrogen compared with the gas stream; (f) withdrawing from the first permeate side, at a second pressure lower than the first pressure and above 25 psia, a first permeate stream depleted in nitrogen compared with the gas stream; (g) introducing the first residue stream into the second membrane unit at a second inlet of the second feed side, and passing the first residue stream across the second feed side; (h) withdrawing from a second outlet of the second feed side a second residue stream enriched in nitrogen compared with the first residue stream; and (i) withdrawing from the second permeate side, at a third pressure lower than the first pressure and above 25 psia, a second permeate stream depleted in nitrogen compared with the first residue stream. The first membrane is more permeable to methane than to nitrogen. The second membrane is more permeable to methane than to nitrogen. It is connected in series with the first membrane unit, such that the gas leaving the first feed side can enter the second membrane unit on the second feed side.    DESCRIPTION OF DRAWING(S) - The figure is a schematic drawing of a process for removing excess nitrogen from methane/nitrogen gas mixtures, including recycle of a second permeate stream and cooling provided by a heat exchange.