The present invention relates to an anhydrous composition comprising:—at least 0.3% by weight of active material of magnesium salt(s) relative to the total weight of the composition;—at least one hydrocarbon-based plant oil; and—at least one fatty acid ester. The invention also relates to a process for the cosmetic treatment of body odor associated with human perspiration, especially underarm odor, and optionally human perspiration, comprising the step of applying a composition as defined above to a skin surface.