Magnesium homeostasis is essential for life and depends on magnesium transporters, whose activity and ion selectivity need to be tightly controlled. Rhomboid intramembrane proteases pervade the prokaryotic kingdom, but their functions are largely elusive. Using proteomics, we find that Bacillus subtilis rhomboid protease YqgP interacts with the membrane-bound ATP-dependent processive metalloprotease FtsH and cleaves MgtE, the major highaffinity magnesium transporter in B. subtilis. MgtE cleavage by YqgP is potentiated in conditions of low magnesium and high manganese or zinc, thereby protecting B. subtilis from Mn 2+ /Zn 2+ toxicity. The N-terminal cytosolic domain of YqgP binds Mn 2+ and Zn 2+ ions and facilitates MgtE cleavage. Independently of its intrinsic protease activity, YqgP acts as a substrate adaptor for FtsH, a function that is necessary for degradation of MgtE. YqgP thus unites protease and pseudoprotease function, hinting at the evolutionary origin of rhomboid pseudoproteases such as Derlins that are intimately involved in eukaryotic ER-associated degradation (ERAD). Conceptually, the YqgP-FtsH system we describe here is analogous to a primordial form of "ERAD" in bacteria and exemplifies an ancestral function of rhomboid-superfamily proteins.