A mathematical model to simulate the three-dimensional growth of multispecies anaerobic biofilms is developed and tested with a two-species biofilm composed of sulfate-reducing bacteria and methanogens. The numerical approach is based on the separation of biological, physical, and chemical phenomena so that quasi-steady-state conditions can be used in the solution. Simulations with Desulfovibrio vulgaris and Methanobacterium formicicum result in the formation of a biofilm heterogeneous in structure and composition. The model predicts different biofilm structures in the absence of sulfate, when a syntrophic association between the two organisms develops, and in the presence of sulfate, when the two organisms compete for the available hydrogen.