US retailer giants Dick’s Sporting Goods and Walmart have announced plans to restrict gun sales following a mass shooting at a Florida high school.

The announcement came as students at Marjory Stoneman Douglas High School in Parkland returned to class for the first time after 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 chief executive Ed Stack said on ABC’s Good Morning America.

This move adds to the growing rift between corporate America and the gun lobby.

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

Dick’s promised to immediately stop selling assault-style rifles and ban the sale of all guns to anyone under 21.

Stack took on the NRA by demanding tougher gun laws after the Florida’s tragedy.

The US largest retailer, Walmart, followed Dick’s decision to restrict gun sale by stopping sales of firearms and ammunition to people younger than 21.

The retailer stopped selling AR-15s and other semi-automatic weapons in 2015 after weak sales.

Stack’s decision was inspired in part by the revelation that the 19-year-old Parkland high school shooter purchased a weapon at a Dick’s store. The firearm was not used in the shooting.

He said: “We did everything by the book. We did everything that the law required, and still he was able to buy a gun. And when we looked at that, we said the systems that are in place across the board just aren’t effective enough to keep us from selling a gun like that. And so we’ve decided we’re not going to sell the assault-type rifles any longer.”

Dick’s Sporting Goods had cut off sales of assault-style weapons after the 2012 Sandy Hook Elementary School shooting. However it resumed the sale of the weapon in its smaller chain of Field & Stream stores consisting of 35 outlets in 16 states as of October.

On 28 February, Stack said this would end. He urged lawmakers to ban assault style firearms, bump stocks and high-capacity magazines as well as raise the minimum age to buy firearms to 21. He also called for stricter checks and a database of those banned from buying firearms.

He said: “The systems that are in place across the board just aren’t effective enough to keep us from selling someone a gun like that and so we’ve decided that we’re not going to sell the assault-type rifles anymore.”

As well as restricting the sale of guns, Walmart pledged to remove items that resemble assault-style rifles—including airsoft guns and toys—from its website.

Walmart said: “We take seriously our obligation to be a responsible seller of firearms and go beyond Federal law by requiring customers to pass a background check before purchasing any firearm. Our heritage as a company has always been in serving sportsmen and hunters, and we will continue to do so in a responsible way.”

The NRA has pushed back aggressively against calls for raising age limits for guns or restricting the sale of assault-style weapons.