The AAA (ATPase associated with various cellular activities) ATPase p97, also referred to as valosin-containing protein (VCP), mediates essential cellular processes, including ubiquitin-dependent protein degradation, and has been linked to several human proteinopathies. p97 interacts with multiple cofactors via its N-terminal (p97N) domain, a subset of which contain the VCP-interacting motif (VIM). We have determined the crystal structure of the p97N domain in complex with the VIM of the ubiquitin E3 ligase gp78 at 1.8 Å resolution. The α-helical VIM peptide binds into a groove located in between the two subdomains of the p97N domain. Interaction studies of several VIM proteins reveal that these cofactors display dramatically different affinities, ranging from high affinity interactions characterized by dissociation constants of ∼20 nm for gp78 and ANKZF1 to only weak binding in our assays. The contribution of individual p97 residues to VIM binding was analyzed, revealing that identical substitutions do not affect all cofactors in the same way. Taken together, the biochemical and structural studies define the framework for recognition of VIM-containing cofactors by p97. Of particular interest to the regulation of p97 by its cofactors, our structure reveals that the bound α-helical peptides of VIM-containing cofactors overlap with the binding site for cofactors containing the ubiquitin regulatory X (UBX) domain present in the UBX protein family or the ubiquitin-like domain of NPL4 as further corroborated by biochemical data. These results extend the concept that competitive binding is a crucial determinant in p97-cofactor interactions.