Coronaviral papain-like proteases (PLpros) are essential enzymes that mediate not only the proteolytic processes of viral polyproteins during virus replication but also the deubiquitination and deISGylation of cellular proteins that attenuate host innate immune responses. Therefore, PLpros are attractive targets for antiviral drug development. Here, we report the crystal structure of papain-like protease 2 (PLP2) of porcine epidemic diarrhea virus (PEDV) in complex with ubiquitin (Ub). The X-ray structural analyses reveal that PEDV PLP2 interacts with the Ub substrate mainly through the Ub core region and C-terminal tail. Mutations of Ub-interacting residues resulted in a moderately or completely abolished deubiquitinylating function of PEDV PLP2. In addition, our analyses also indicate that 2-residue-extended blocking loop 2 at the S4 subsite contributes to the substrate selectivity and binding affinity of PEDV PLP2. Furthermore, the PEDV PLP2 Glu99 residue, conserved in alphacoronavirus PLpros, was found to govern the preference of a positively charged P4 residue of peptidyl substrates. Collectively, our data provided structure-based information for the substrate binding and selectivity of PEDV PLP2. These findings may help us gain insights into the deubiquitinating (DUB) and proteolytic functions of PEDV PLP2 from a structural perspective.