NOVELTY - The process is for liquefying a compound (A), e.g. methane, from a mixture consisting of at least the compound (A) and one or more compounds (B), e.g. nitrogen and helium with a lower boiling point, where the compounds (B) are separated from the compound (A) by distillation. Liquefaction is performed by at least two successive expansion steps, the distillation step for separating the compounds occurring after the first expansion step and before the second expansion step.    USE - For extracting methane and/or helium during a gas liquefaction process, such as natural gas containing methane as its main constituent and nitrogen and/or helium as constituents to be extracted, or for extracting argon and/or nitrogen during an air liquefaction process (both claimed).    ADVANTAGE - Extracts unwanted compounds during the liquefaction process.    DETAILED DESCRIPTION - The process involves at least two successive expansion steps and produces: (i) a gaseous effluent at a pressure (P2) lower than the pressure (P1) of the compound mixture, consisting of almost all of the compounds (B) and possibly containing variable proportions of compound (A); (ii) a liquefied effluent at a pressure (P3) lower than (P2), consisting for the most part of compound (A) from which the compounds (B) have been removed. The separation by distillation takes place at a pressure close to (P2) in order to produce at least one flow (F1) consisting mostly of compound (A) and at least on flow (F4) containing almost all of the compounds (B).    Preferred Features: The distillation step takes place in a column. A flow leaving the column is condensed, the flow (F2) containing the compounds (B) and a part of the compounds (A) so as to produce a slow (F3) which s rich in compounds (A) and the flow (F4), and at least some of the flow (F) is used as reflux. Reflux of the column is generated by an exchange of heat between the flow (F2) from the head of the column and at least one of the cold fluids recovered at the end of the later expansion stages of the liquefaction process. Turbo-expanders are used to perform the expansion steps.    DESCRIPTION OF DRAWING(S) - The drawing shows a diagrammatic illustration of the liquefaction process.    contact unit (C1)    drum (DX1-4)    compressor (KX1-4)    separating drum (S)    expansion turbines (X1-4)    separator device (51)    pump (54)