The twin-arginine translocation (Tat) pathway is dedicated to the transport of fully folded proteins across the cytoplasmic membranes of many bacteria and the chloroplast thylakoidal membrane. Accordingly, Tat-dependently translocated proteins are known to be delivered to the periplasm of Gram-negative bacteria, the growth medium of Gram-positive bacteria, and the thylakoid lumen. Here, we present the first example of a protein, YkuE of Bacillus subtilis, that is specifically targeted by the Tat pathway to the cell wall of a Gram-positive bacterium. The cell wall binding of YkuE is facilitated by electrostatic interactions. Interestingly, under particular conditions, YkuE can also be targeted to the cell wall in a Tat-independent manner. The biological function of YkuE was so far unknown. Our present studies show that YkuE is a metal-dependent phosphoesterase that preferentially binds manganese and zinc.