NEW YORK  — Walmart said Wednesday that it will raise the minimum age for tobacco products and e-cigarettes to 21 in all its U.S. stores in an effort to combat tobacco sales to minors. It will also stop selling solutions and pods for e-cigarettes that are flavored like fruit or desserts.

The world’s largest retailer said the new rules will take effect in July, and will also include its Sam’s Club warehouse stores.

Previously, its minimum purchase age was 18, aside from a number of states where the law required a minimum purchase age of 21.

Last month, drugstore operator Walgreens also said it would increase the minimum age for tobacco sales to 21 after the Food and Drug Administration accused it of repeatedly selling them to minors.