Many bacteria are highly adapted for life in communities, or biofilms. A defining feature of biofilms is the production of extracellular matrix that binds cells together. The biofilm matrix provides numerous fitness benefits, including protection from environmental stresses and enhanced nutrient availability. Here we investigate defense against biofilm invasion using the model bacterium Vibrio cholerae. We demonstrate that immotile cells, including those identical to the biofilm resident strain, are completely excluded from entry into resident biofilms. Motile cells can colonize and grow on the biofilm exterior, but are readily removed by shear forces. Protection from invasion into the biofilm interior is mediated by the secreted protein RbmA, which binds mother-daughter cell pairs to each other and to polysaccharide components of the matrix. RbmA, and the invasion protection it confers, strongly localize to the cell lineages that produce it.