Target Corp. said it will spend $20 million to add a private bathroom to each of its stores by next year, following customer protests over its policy allowing transgender individuals to use whichever restroom corresponds with their gender identity.

Most of Target’s TGT, +0.69% 1,797 locations already have single-occupancy or unisex restrooms, but it will add the option to 277 stores by November and to about 20 remaining stores by March 2017, the company said Wednesday.