Decentralized sanitary wastewater treatment has become a viable and sustainable alternative, especially for developing countries and small communities. Besides, effluents may present variations in chemical oxygen demand (COD), biochemical oxygen demand (BOD) and total nitrogen values. This study describes the feasibility of using a pilot upflow anaerobic sludge blanket (UASB) reactor to treat wastewater with different organic loads (COD), using black water (BW) and sanitary wastewater, in addition to its potential for preserving nutrients for later recovery and/or reuse. The UASB reactor was operated continuously for 95 weeks, with a hydraulic retention time of 3 days. In Phase 1, the reactor treated simulated BW and achieved 77% CODtotal removal. In Phase 2, treating only sanitary wastewater, the CODtotal removal efficiency was 60%. Phase 3 treated simulated BW again, and CODtotal removal efficiency was somewhat higher than in Phase 1, reaching 81%. In Phase 3, the removal of pathogens was also evaluated: the efficiency was 1.96 log for Escherichia coli and 2.13 log for total coliforms. The UASB reactor was able to withstand large variations in the organic loading rate (0.09–1.49 kg COD m−3 d−1), in continuous operation mode, maintaining a stable organic matter removal.