Spatial self-organization is the main theoretical explanation for the global occurrence of regular or otherwise coherent spatial patterns in ecosystems. Using mussel beds as a model ecosystem, we provide an experimental demonstration of spatial self-organization. Under homogeneous laboratory conditions, mussels developed regular patterns, similar to those in the field. An individual-based model derived from our experiments showed that interactions between individuals explained the observed patterns. Furthermore, a field study showed that pattern formation affected ecosystem-level processes in terms of improved growth and resistance to wave action. Our results imply that spatial self-organization is an important determinant of the structure and functioning of ecosystems, and it needs to be considered in their conservation.