The US should keep assault rifles out of the hands of anyone under 21, President Donald Trump has declared, defying his loyal supporters in the National Rifle Association amid America's public reckoning over gun violence.

He also pushed hard for arming security guards and many teachers in U.S. schools.

"There's nothing more important than protecting our children," Trump said, adding that he'd spoken with many members of Congress and NRA officials and insisting they would go along with his plans in the wake of last week's school shooting in Parkland, Florida, that left 17 people dead.

But there were no words of support from the NRA for his age-limit proposal - and outright opposition from organisations of teachers and school security guards for the idea of arming schools to deal with intruders.

"The NRA will back it and so will Congress," Trump contended as he called for raising the legal age of purchase for "all" guns from 18 to 21.

A spokesman later said Trump was speaking specifically about semi-automatic weapons. The president's proposal came just hours after the NRA affirmed its opposition, calling such a restriction an infringement on gun owners' rights.

Trump has spent the past two days listening to ideas about how to stem gun violence at schools after last week's shooting at Marjory Stoneman Douglas High School.

In Florida, meanwhile, funerals continued. And a sheriff's deputy who had been on duty at the school but never went inside to confront the shooter resigned after being suspended without pay.

NRA leaders emerged in unannounced appearances at the annual Conservative Political Action Conference, blaming the FBI and local reporting failures for the Florida shooting.

NRA officials also accused Democrats and media outlets of exploiting the Florida shooting.