Granular biomass has been proposed as an alternative to activated sludge for the sewage treatment. The morphological characteristics of granular biomass, provides granules two main advantages over flocular biomass: (i) the ability of settling faster, and (ii) the possibility of performing aerobic, anoxic and anaerobic processes simultaneously. Two different granular systems have a demonstrated potential for the treatment of urban wastewater. First, aerobic granular sequencing batch reactors (GSBR), which perform the same nutrient removal process occurring in activated sludge systems, but taking advantage of the abovementioned granular sludge properties. Second, an anammox-based sewage treatment, which could allow obtaining a more sustainable (energy-neutral or even energy-positive) wastewater treatment. This thesis is focused in improving the knowledge of these granular biomass systems towards confirming granular biomass as a real alternative to urban wastewater treatment with activated sludge. For urban wastewater treatment with GSBRs, two different studies were done. First, the stability of granules and their performance at pilot scale were first studied in a 100 L GSBR treating low-strength wastewater for simultaneous carbon, nitrogen and phosphorus removal was operated for eleven months. Mature granules prevailed in the GSBR during a period of five months. The biological nitrogen removal with mature granules was mainly performed via nitrite. Nitrification efficiency was higher than 75% and occurred simultaneously with denitrification during the aerobic phase of the GSBR. A progressive accumulation of P-salts (probably apatite), was found from days 150 to 300, which could enhance the destabilization of granules at the end of the experimental period. Second, a model-based study was carried out to determine the guidelines to design an automatic control strategy with the final aim of enhancing biological N-removal in a GSBR. Specific simulations were designed to elucidate the effect of DO concentration, granule size, influent C/N ratio and NLR on the nitrification-denitrification efficiency. Simulation results showed that, in general, high N-removal efficiencies (from 70 to 85 %) could be obtained only setting the appropriate DO concentration. That appropriate DO concentration could be easily found based on effluent ammonium concentration. Those results were used to propose a control strategy to enhance N-removal efficiencies. Regarding the anammox-based sewage treatment in a two-step system, two additional studies were carried out. For the partial nitritation step, a bench-scale granular sludge bioreactor was operated in continuous mode with a low nitrogen concentration wastewater at low temperatures. An effluent suitable to feed a subsequent anammox reactor was maintained stable during more than 450 days, including more than 365 days at temperatures equal or lower than 15ºC. A previously existing mathematical model was used to determine why partial nitritation was feasible. Simulations showed that NOB was only effectively repressed when their oxygen half-saturation coefficient was higher than that of AOB. Simulations also indicated that a lower specific growth rate of NOB was maintained at any point in the biofilm due to the bulk ammonium concentration imposed through the control strategy. Finally, pyrosequencing technique was used to explore the microbial community structure changes during the recovery process of an anammox granular reactor after a temperature shock. The temperatures shock reduced the nitrogen removal rate up to 92% compared to that just before the temperature shock, and it took 70 days to recover a similar nitrogen removal rate to that before the temperature shock. Pyrosequencing results indicated that microbial diversity in the reactor decreased as the reactor progressively recovered from the temperature shock. In general, pyrosequencing results were in agreement with N-removal performance results and SAA measured in the reactor during the recovery process. An anammox specific primer was used to precisely determine the anammox species in the biomass samples.