Ubiquitin is a key regulatory molecule in diverse cellular events. How cells determine the outcome of ubiquitylation remains unclear; however, a likely determinant is the specificity of ubiquitin receptor proteins for polyubiquitin chains of certain length and linkage. Proteasome subunit S5a contains two ubiquitin-interacting motifs (UIMs) through which it recruits ubiquitylated substrates to the proteasome for their degradation. Here, we report the structure of S5a (196-306) alone and complexed with two monoubiquitin molecules. This construct contains the two UIMs of S5a and we reveal their different ubiquitin-binding mechanisms and provide a rationale for their unique specificities for different ubiquitin-like domains. Furthermore, we provide direct evidence that S5a (196-306) binds either K63-linked or K48-linked polyubiquitin, and in both cases prefers longer chains. On the basis of these results we present a model for how S5a and other ubiquitin-binding proteins recognize polyubiquitin.