Compartmentalization is an important organizational feature of life. It occurs at varying levels of complexity ranging from eukaryotic organelles and the bacterial microcompartments, to the molecular reaction chambers formed by enzyme assemblies. The structural basis of enzyme encapsulation in molecular compartments is poorly understood. Here we show, using X-ray crystallographic, biochemical and EM experiments, that a widespread family of conserved bacterial proteins, the linocin-like proteins, form large assemblies that function as a minimal compartment to package enzymes. We refer to this shell-forming protein as 'encapsulin'. The crystal structure of such a particle from Thermotoga maritima determined at 3.1-angstroms resolution reveals that 60 copies of the monomer assemble into a thin, icosahedral shell with a diameter of 240 angstroms. The interior of this nanocompartment is lined with conserved binding sites for short polypeptide tags present as C-terminal extensions of enzymes involved in oxidative-stress response.