Rite Aid announced Tuesday it will raise its minimum age for tobacco sales to 21 years old, following the same announcement earlier in the day by Walgreens.

The moves come several weeks after a top federal official chastised Walgreens for violating laws restricting access to cigarettes and other tobacco products.

Deerfield, Illinois-based Walgreens Boots Alliance Inc. said Tuesday that it will require customers to be at least 21 years old to purchase tobacco in any of its more than 9,500 stores nationwide. The policy starts Sept. 1.

Former Food and Drug Administration Commissioner Dr. Scott Gottlieb said in March that Walgreens was a top violator of tobacco sales laws among pharmacies that sell those products. Rival CVS Health Corp. stopped several years ago.

Rite Aid said its decision is based on research that shows 95 percent of adult smokers have their first cigarette before age 21.

"By raising the purchase age, we are furthering our commitment to promoting responsible access to tobacco products," Bryan Everett, Rite Aid chief operating officer, said in a statement.

Rite Aid said its decision will take effect in 90 days. The company also said it previously announced plans to remove e-cigarettes and vaping products from its stores.

Laws restricting tobacco sales vary nationally.

Most states have set a minimum age of 18, while a dozen have raised that to 21, according to the American Lung Association. Alaska and Alabama set their minimum ages at 19. Many cities and counties also have passed local laws establishing the minimum at 21.

Senate Majority Leader Mitch McConnell said last week that he plans to introduce legislation to raise the minimum age to 21 nationally. The Kentucky Republican called the legislation a top priority.