US President Donald Trump has criticised the FBI for allegedly spending too much time on the Russia investigation instead of preventing the Florida school shooting.

Trump said on Twitter late on Saturday that it was "very sad that the FBI missed all the many signals sent out by the Florida school shooter."

"This is not acceptable. They are spending too much time trying to prove Russian collusion with the Trump campaign - there is no collusion," he said.

Trump's remarks came after the FBI said it received a tip last month that the shooting suspect, 19-year-old Nikolas Cruz, had a "desire to kill" and access to guns, but the FBI agents failed to act on the information.

Trump also criticised the Democrats for their failure to pass gun control legislation.

"Why didn't the Democrats pass gun control legislation when they had both the House Senate during the Obama Administration. Because they didn't want to, and now they just talk!" he said on Twitter, referring to the administration of former US President Barack Obama.

Push for gun control

Also on Saturday, thousands of students, parents, teachers and neighbours held signs and pushed for gun control legislation in Fort Lauderdale, Florida, days after 17 people were shot and killed at a high school about 40km away.

The rally gave a political outlet to the growing feelings of rage and mourning sparked by the carnage at Marjory Stoneman Douglas High School in the town of Parkland on Wednesday.

Authorities say a former student with mental health issues who had been expelled and reported to authorities used a legally purchased semi-automatic rifle to kill students and staff.

Student Emma Gonzalez told the crowd that politicians should stop taking donations from the National Rifle Association. She yelled, "Shame on you", and the crowd repeated her.

Anger over the massacre on Wednesday also has led to calls for walkouts, sit-ins and other actions on school campuses nationwide that are aimed at pushing legislators to pass tougher gun laws.