In nature, bacteria predominantly exist as highly structured biofilms, which are held together by extracellular matrix. These complex communities protect their residents from environmental insults, and can be up to 1000 times more resistant to antibiotics than single cells. Recently, we identified a new mechanism maintaining and protecting biofilms – an active production of calcite minerals in a subpopulation of cells. The minerals are produced within discrete foci in the periplasm of biofilm cells, released from the cell, and finally mature by interactions with the extracellular matrix. Our results imply that dense and structured calcium carbonate lamina forms a diffusion barrier sheltering the inner cell mass. This defensive layer provides a fitness advantage to the cells residing in the multicellular differentiated bacterial community upon exposure to antibiotics. Furthermore, we demonstrate that interference with cellular pathways driving biomineralization can inhibit the assembly of complex bacterial structures and increase biofilm permeability. Our work provides insights into the relationship between the behavior of single cells, bacterial biofilm structure and function. We highlight the advantages of cooperation between bacterial cells composing a differentiated complex community, as a strategy for surviving an external insult. Most importantly, we offer a novel class of therapeutic targets for highly resistant biofilms infections.