Kroger, the nation's largest grocery chain, said it will stop selling guns and ammunition to customers who are younger than 21 years old. It's the third major retailer in two days to impose new age restrictions on sales.

Kroger (KR) sells weapons and ammunition at 45 Fred Meyer stores located in four western states. Those stores sell general merchandise. The Kroger grocery stores do not sell weapons.

Related: Dick's Sporting Goods will stop selling assault-style rifles

It is already illegal for licensed gun sellers to sell handguns to anyone under the age of 21, but it is legal under federal law to sell rifles of any kind -- including assault-style -- to anyone 18 or older.

The company joins Dick's Sporting Goods (DKS), the nation's largest sporting goods retailer, and Walmart (WMT), the nation's largest retailer, which both said Wednesday that they would stop selling weapons and ammunition of any kind to anyone under 21. Dick's also said it would stop selling assault-style weapons. Walmart stopped selling those kinds of weapons in 2015.

"In response to the tragic events in Parkland and elsewhere, we've taken a hard look at our policies and procedures for firearm sales," Kroger said in a statement. "Recent events demonstrate the need for additional action on the part of responsible gun retailers."

The company said that it stopped selling "assault-style rifles" at its Oregon, Washington and Idaho stores several years ago, and that it will no longer accept any special orders for those weapons at its stores in Alaska.

Kroger said it is also in the process of scaling back gun departments at some stores "due to softer demand and changing customer preferences."

Related: Who's still selling assault-style rifles?

"We believe these are common sense steps we can take immediately that are in line with our values and our vision," said the company.

There have been proposals since the school shooting in Parkland, Florida, to raise the minimum age for any gun purchase to 21. Nikolas Cruz, the 19 year-old shooter, legally bought at least 10 rifles, a law enforcement source told CNN.

But many gun rights advocates such as the National Rifle Association oppose raising the age limit to buy a weapon.