S-layers are regular two-dimensional semipermeable protein layers that constitute a major cell-wall component in archaea and many bacteria. The nanoscale repeat structure of the S-layer lattices and their self-assembly from S-layer proteins (SLPs) have sparked interest in their use as patterning and display scaffolds for a range of nano-biotechnological applications. Despite their biological abundance and the technological interest in them, structural information about SLPs is limited to truncated and assembly-negative proteins. Here we report the X-ray structure of the SbsB SLP of Geobacillus stearothermophilus PV72/p2 by the use of nanobody-aided crystallization. SbsB consists of a seven-domain protein, formed by an amino-terminal cell-wall attachment domain and six consecutive immunoglobulin-like domains, that organize into a φ-shaped disk-like monomeric crystallization unit stabilized by interdomain Ca(2+) ion coordination. A Ca(2+)-dependent switch to the condensed SbsB quaternary structure pre-positions intermolecular contact zones and renders the protein competent for S-layer assembly. On the basis of crystal packing, chemical crosslinking data and cryo-electron microscopy projections, we present a model for the molecular organization of this SLP into a porous protein sheet inside the S-layer. The SbsB lattice represents a previously undescribed structural model for protein assemblies and may advance our understanding of SLP physiology and self-assembly, as well as the rational design of engineered higher-order structures for biotechnology.