Compatible solutes such as glycine betaine and proline betaine are accumulated to exceedingly high intracellular levels by many organisms in response to high osmolarity to offset the loss of cell water. They are excluded from the immediate hydration shell of proteins and thereby stabilize their native structure. Despite their exclusion from protein surfaces, the periplasmic ligand-binding protein ProX from the Escherichia coli ATP-binding cassette transport system ProU binds the compatible solutes glycine betaine and proline betaine with high affinity and specificity. To understand the mechanism of compatible solute binding, we determined the high resolution structure of ProX in complex with its ligands glycine betaine and proline betaine. This crystallographic study revealed that cation-pi interactions between the positive charge of the quaternary amine of the ligands and three tryptophan residues forming a rectangular aromatic box are the key determinants of the high affinity binding of compatible solutes by ProX. The structural analysis was combined with site-directed mutagenesis of the ligand binding pocket to estimate the contributions of the tryptophan residues involved in binding.