Anaerobic digestion of organic material, particularly biological sludge, such as sewage sludge, is carried out in a closed system having a first digestion tank and a second concentration and partial digestion tank. The concentrated and partially digested sludge is fed to the first tank where it is maintained under vacuum such that an active zone of organic material undergoing digestion is detained therein for a long period of time. The digested sludge is withdrawn against the vacuum and has approximately 80 to 90% of the organic solids therein mineralized; thus simplifying dewatering and ultimate disposal of the sludge. Pathogens including viruses are also removed from the digested sludge. Denitrification takes place in the vacuum digester tank and gas consisting essentially of nitrogen is removed. Return sludge from the vacuum digester and influent sludge is fed into the second or concentrator tank to facilitate reseeding with anaerobic organisms. Both tanks are provided with passageways which are coterminous near the upper ends of the tanks and provided with baffles which direct the flow to be in opposite directions in the passageways, thus providing for stripping of the gas and solid-liquid separation. Gas consisting essentially of methane and carbon dioxide is produced from the second tank. Supernatant from the second tank may be recirculated to the source of the sludge to facilitate degradation of remaining organic contaminants. For the production of ammonia gas, the pressure in the first tank is cycled repeatedly between vacuum and atmospheric or just above atmospheric pressure; the ammonia gas being withdrawn with the digested sludge.