Abstract: A system and method for removing nitrogen and producing liquefied natural gas (“LNG”) from methane without the need for external refrigeration. The invention also relates to a system and method for removing nitrogen from methane and for producing liquefied nitrogen in addition to LNG. The system and method of the invention are particularly suitable for use in recovering and processing comparatively small volumes of methane from coal mines or from flash gas captured at an LNG loading site.