The reversal of ubiquitination induced by members of the SidE effector family of Legionella pneumophila produces phosphoribosyl ubiquitin (PR-Ub) that is potentially detrimental to host cells. Here we show that the effector LnaB functions to transfer the AMP moiety from ATP to the phosphoryl moiety of PR-Ub to convert it into ADP-ribosylated ubiquitin (ADPR-Ub), which is further processed to ADP-ribose and functional ubiquitin by the (ADP-ribosyl)hydrolase MavL, thus maintaining ubiquitin homeostasis in infected cells. Upon being activated by Actin, LnaB also undergoes self-AMPylation on tyrosine residues. The activity of LnaB requires a motif consisting of Ser, His and Glu (S-HxxxE) present in a large family of toxins from diverse bacterial pathogens. Our study not only reveals intricate mechanisms for a pathogen to maintain ubiquitin homeostasis but also identifies a new family of enzymes capable of protein AMPylation, suggesting that this posttranslational modification is widely used in signaling during host-pathogen interactions.