Organelle identity depends on protein composition. How mistargeted proteins are selectively recognized and removed from organelles is incompletely understood. Here, we found that the orphan P5A-adenosine triphosphatase (ATPase) transporter ATP13A1 (Spf1 in yeast) directly interacted with the transmembrane segment (TM) of mitochondrial tail-anchored proteins. P5A-ATPase activity mediated the extraction of mistargeted proteins from the endoplasmic reticulum (ER). Cryo-electron microscopy structures of Saccharomyces cerevisiae Spf1 revealed a large, membrane-accessible substrate-binding pocket that alternately faced the ER lumen and cytosol and an endogenous substrate resembling an α-helical TM. Our results indicate that the P5A-ATPase could dislocate misinserted hydrophobic helices flanked by short basic segments from the ER. TM dislocation by the P5A-ATPase establishes an additional class of P-type ATPase substrates and may correct mistakes in protein targeting or topogenesis.