An apparatus for liquefaction of and nitrogen extraction from natural gas under pressure containing methane, C2, and higher hydrocarbons and nitrogen, for obtaining liquefied natural gas essentially free of nitrogen, and gaseous nitrogen essentially free of hydrocarbons, the apparatus including means for carrying out a first step in which natural gas is cooled, has its pressure reduced, and is liq