A biofilm with high nitrifying efficiency was converted into a nitritating and thereafter a nitritating-anammox biofilm in a moving-bed biofilm reactor at 26.5 (+/- 0.5) degrees C by means of a combination of intermittent aeration, low dissolved oxygen concentration, low hydraulic retention time, free ammonia and furthermore, also by elevated HCO3- concentration. Nitrite-oxidizing bacteria (NOB) were more effectively suppressed by an enhanced HCO3- concentration range of 1200-2350 mg/L as opposed to free-ammonia-based process control where NOBs recovered from inhibition; the respective total-nitrogen removal rates were 0.3 kg N/(m3 x d) and 0.2 kg N/(m3 x d). The biofilm modification strategies resulted in a shift in bacterial community as the NOB Nitrobacter spp. were replaced with NOB belonging to the genus Nitrospira spp. and were closely related to Candidatus Nitrospira defluvii. A community of anaerobic ammonium-oxidizing microorganisms -uncultured Planctomycetales bacterium clone P4 (closely related to Candidatus Brocadia fulgida)--was developed.