A computational model explaining formation of mushroom-like biofilm colonies is proposed in this study. The biofilm model combines for the first time cell growth with twitching motility in a three-dimensional individual-based approach. Model simulations describe the tendency of motile cells to form flat biofilms spreading out on the substratum, in contrast with the immotile variants that form only round colonies. These computational results are in good qualitative agreement with the experimental data obtained from Pseudomonas aeruginosa biofilms grown in flowcells. Simulations reveal that motile cells can possess a serious ecological advantage by becoming less affected by mass transfer limitations. Twitching motility alone appears to be insufficient to generate mushroom-like biofilm structures with caps on stalks. Rather, a substrate limitation-induced detachment of motile cells followed by reattachment could explain this intriguing effect leading to higher-level biofilm structure.