Donald Trump has attacked the FBI for failing to stop the Florida school shooting suspect and “spending too much time” trying to link his election campaign to Russia.

The US President responded to criticisms of his handling of the tragedy by lashing out at the intelligence agency for missing warning signs before Nikolas Cruz shot dead 14 pupils and three members of staff.

He tweeted: “This is not acceptable. They are spending too much time trying to prove Russian collusion with the Trump campaign – there is no collusion. Get back to the basics and make us all proud!”

Mr Trump followed it up with a tweet claiming that the Russians were only colluding with Hillary Clinton and the Democratic Party.

His attack on the FBI came after the indictment of 13 Russians for meddling in the 2016 US election on charges brought by special counsel Robert Mueller.

Cruz has confessed to the Valentine’s Day shooting at Marjory Stoneman Douglas High School in Parkland, which was the deadliest US school shooting since 2012.

The FBI has admitted it failed to act on a tip-off that he had access to guns, had a “desire to kill”, and could be plotting an attack.

In a statement, the intelligence agency said the information should have been assessed as a threat to life and passed on to its Miami field office.

FBI director Christopher Wray, who is now facing calls from Republicans to resign, said: “We have spoken with victims and families, and deeply regret the additional pain this causes all those affected by this horrific tragedy. All of the men and women of the FBI are dedicated to keeping the American people safe, and are relentlessly committed to improving all that we do and how we do it.”

The Parkland massacre prompted thousands of students, parents and teachers to hold an anti-gun rally at Fort Lauderdale.

One survivor, Emma Gonzalez, rounded on Trump’s focus on “mental health” in a passionate speech calling for stricter gun control.

Ms Gonzalez said: “If the President wants to come up to me and tell me to my face that it was a terrible tragedy and ... how nothing is going to be done about it, I’m going to happily ask him how much money he received from the National Rifle Association ... It doesn’t matter because I already know. Thirty million dollars.”