NEW YORK -- Dick's Sporting Goods and Walmart took steps Wednesday to restrict gun sales, adding two retail heavyweights to the growing rift between corporate America and the gun lobby.

Dick's said it will and ban the sale of all guns to anyone under 21. Its CEO took on the National Rifle Association by demanding tougher gun laws after the massacre in Florida.

Walmart, the nation's largest retailer, followed late Wednesday saying it will no longer sell firearms and ammunition to people younger than 21. It had stopped selling AR-15s and other semi-automatic weapons in 2015, citing weak sales.

The announcements from the major national retailers came as students at Marjory Stoneman Douglas High School in Parkland, Florida, returned to class for the first time since a teenager killed 17 students and educators with an AR-15 rifle two weeks ago.

"When we saw what the kids were going through and the grief of the parents and the kids who were killed in Parkland, we felt we needed to do something," Dick's Chairman and CEO Ed Stack said on ABC's "Good Morning America."

Several major corporations, including MetLife, Hertz and Delta Air Lines, have cut ties with the NRA since the Florida tragedy. None of them were retailers who sold guns.

Sporting goods chain Bass Pro Shops, which owns Cabela's, didn't respond to requests for comment. Nor did the Outdoor Retail Association or Gander Outdoors.

The announcements from Dick's and Walmart drew hundreds of thousands of responses for and against the moves on the companies' social media accounts.

Dick Sporting Goods had cut off sales of assault-style weapons after the 2012 Sandy Hook Elementary School shooting. But sales had resumed at its smaller chain of Field & Stream stores, which consisted of 35 outlets in 16 states as of October.

On Wednesday, Stack said that would end, and he called on lawmakers to act now.

He urged them to ban assault-style firearms, bump stocks and high-capacity magazines and raise the minimum age to buy firearms to 21. He said universal background checks should be required, and there should be a complete database of those banned from buying firearms. He also called for the closing of the private sale and gun show loophole that enables purchasers to escape background checks.

"We support and respect the Second Amendment, and we recognize and appreciate that the vast majority of gun owners in this country are responsible, law-abiding citizens," Stack said in a letter. "But we have to help solve the problem that's in front of us. Gun violence is an epidemic that's taking the lives of too many people, including the brightest hope for the future of America -- our kids."

Walmart said it was also removing items from its website that resemble assault-style rifles, including airsoft guns and toys. "Our heritage as a company has always been in serving sportsmen and hunters, and we will continue to do so in a responsible way," Walmart said.

One industry analysts said that other retailers that devote a small percentage of their business to hunting will probably follow suit. While guns can be bought from sporting goods stores or department stores, they can also be purchased online, at gun shows and from small local gun stores.

The NRA has pushed back aggressively against calls for raising age limits for guns or restricting the sale of assault-style weapons. Calls to the NRA were not immediately returned.

Stack also revealed that Nikolas Cruz, the 19-year-old arrested in the Florida attack, had bought a shotgun at a Dick's store within the past four months.

"It was not the gun, nor type of gun, he used in the shooting," the CEO wrote. "But it could have been. Clearly this indicates on so many levels that the systems in place are not effective to protect our kids and our citizens."

The vast majority of Dick's business is selling sporting goods like basketballs and sneakers. Joseph Feldman, a senior managing director at the Telsey Advisory Group, estimated that guns and ammunition account for 8 per cent of the company's sales.

Dick's, which had net sales of $7.92 billion in the fiscal year that ended in January 2017, has a much bigger stake in youth sports.

"The longer-term positive perception that they create a more welcoming environment will offset any lost sales in the year," Feldman said.

Dick's is based just outside of Pittsburgh in a state where the first day of deer hunting season is an unofficial holiday for many families. Stack said Dick's is prepared for any backlash but will never allow the sale of such guns in its stores again.

"This is the moment when business leaders across the country get to decide if they want to stand on the right side of history," said Shannon Watts, founder of Moms Demand Acton for Gun Sense in America. "Mothers make the majority of spending decisions for their families, and we want to shop with businesses that care about the safety of our families -- making this a smart business move, too."

Pam Platt of Louisville, Kentucky, said she was thrilled to hear about Dick's move and called the store's customer service line to offer her praise. She said she told the representative who answered that she wanted her to "hear something good from somebody."

"She perked up," Platt added.

Platt said she now plans to start buying more at her local Dick's store, including a pair of sneakers this week.

"When I go to the store, I will let them know why I am here," she said. "I care about this issue."

But many others were unhappy with the company's move, some posting on the Dick's page that they would stop shopping at its stores.

"I was sad to hear they would pull them off and bow to these people that have no understanding of what a gun is," said Gerald Jaeger, outside a Dick's in Brookfield, Wisconsin.

Dick's stock price was little changed as of midafternoon Wednesday afternoon, up 1.7 per cent.

------

AP Retail Writers Anne D'Innocenzio and Joseph Pisani contributed to this report. Associated Press reporter Carrie Antlfinger contributed from Brookfield, Wisconsin.