Cement-based materials are the foundation of modern buildings but suffer from intensive energy consumption. Utilizing cement-based materials for efficient energy storage is one of the most promising strategies for realizing zero-energy buildings. However, cement-based materials encounter challenges in achieving excellent electrochemical performance without compromising mechanical properties. Here, we introduce a biomimetic cement-based solid-state electrolyte (labeled as
l
-CPSSE) with artificially organized layered microstructures by proposing an in situ ice-templating strategy upon the cement hydration, in which the layered micropores are further filled with fast-ion-conducting hydrogels and serve as ion diffusion highways. With these merits, the obtained
l
-CPSSE not only presents marked specific bending and compressive strength (2.2 and 1.2 times that of traditional cement, respectively) but also exhibits excellent ionic conductivity (27.8 mS·cm
−1
), overwhelming most previously reported cement-based and hydrogel-based electrolytes. As a proof-of-concept demonstration, we assemble the
l
-CPSSE electrolytes with cement-based electrodes to achieve all-cement-based solid-state energy storage devices, delivering an outstanding full-cell specific capacity of 72.2 mF·cm
−2
. More importantly, a 5 × 5 cm
2
sized building model is successfully fabricated and operated by connecting 4
l
-CPSSE-based full cells in series, showcasing its great potential in self-energy-storage buildings. This work provides a general methodology for preparing revolutionary cement-based electrolytes and may pave the way for achieving zero-carbon buildings.