A biogas plant produces both methane and liquid fertilizer by fermenting biomass. The plant includes a fermenter, a percolate tank and a sanitation tank located inside the percolate tank. Dry fermentation takes place in the fermenter and generates methane and a percolate. The percolate is circulated between the fermenter and the percolate tank. Percolate that is returned from the percolate tank to the fermenter is sprinkled over the biomass. A portion of the percolate is transferred from the percolate tank into the sanitation tank. The percolate in the sanitation tank is sanitized by heating to a Celsius temperature between 45° and 65° for a period of at least five days. The percolate in the sanitation tank is heated using both a heating device in the sanitation tank as well as heat generated from a thermophilic fermentation reaction occurring in the percolate tank. The sanitized percolate is used as liquid fertilizer.