A method for treating a sludge derived from sewage or wastewater, the method comprising subjecting the sludge to a treatment step at a pH of 8.9 or greater and a free ammonia (FA) content of 100 mg NH3-N/L or greater. The treated sludge may be fed to a bioreactor to produce methane.