Media playback is unsupported on your device Media caption "We knew it wasn't a drill": Students, police and politicians react in the aftermath of the shooting

At least 17 people are dead after a 19-year-old man opened fire at a high school campus in Parkland, Florida.

The suspect was Nikolas Cruz, a former student at the school who had been expelled. He escaped with fleeing students but is now in police custody.

As the attack unfolded students were forced to hide as police swooped in on the building.

It is the deadliest school shooting since 26 people were killed at Connecticut school Sandy Hook in 2012.

It is the sixth school shooting incident this year so far that has either wounded or killed students.

Broward County Sheriff Scott Israel told reporters Mr Cruz killed three people outside the school, before entering the building and killing another 12.

Two people later died after being taken to hospital.

"It's catastrophic. There really are no words," Sheriff Israel tweeted later.

Media playback is unsupported on your device Media caption After the Las Vegas attack in October 2017 the BBC looked at how US mass shootings are getting worse

Three people remain in a critical condition and three others are in stable condition, health officials said.

The victims are still being identified. Sheriff Israel said a football coach was among the dead but no names have been released.

How the attack unfolded

The attack began at 14:30 local time (19:30 GMT) on Wednesday at the Marjory Stoneman Douglas High School in Parkland, about an hour north of Miami.

The local public school district tweeted that "students and staff heard what sounded like gunfire" just before the end of the day.

Witnesses said that the suspect set off a fire alarm before he began shooting.

Police and Swat team members swarmed the campus and began clearing students from the school, as parents and ambulances converged on the scene.

Image copyright Getty Images Image caption Video footage from the scene showed students being evacuated in small groups

Mr Cruz, who had been expelled for "disciplinary reasons", was taken into custody without incident in the nearby town of Coral Springs about an hour after he left the high school, according to police.

Officials gave no details of the reasons for his expulsion but student Victoria Olvera, 17, told the Associated Press it was because of a fight with his ex-girlfriend's new boyfriend.

She also said he had been abusive towards the ex-girlfriend.

Local media report that Mr Cruz bought his gun, an AR-15, legally and kept it locked away in the house of the family he was staying with, following his adoptive mother's death in November.

Neighbours and friends said Mr Cruz was known to shoot at chickens, and talk about shooting lizards, squirrels and frogs.

"We have already begun to dissect his websites and things on social media that he was on and some of the things... are very, very disturbing," Sheriff Israel said.

Image copyright Broward’s Sheriff’s Office Image caption Police released a photo of Nikolas Cruz

'Worst nightmare'

The school has nearly 3,000 students. Classes are cancelled for the rest of this week.

Many students said they thought it was a drill because a fire alarm practice had taken place shortly before the shooting.

Students told US media they hid under desks, in closets or barricaded doors as loud shots rang out.

One student, Bailey Vosberg, said: "I heard what sounded like fireworks and I looked at my friend and he asked me if I heard that."

"Immediately, I knew. I didn't say anything to him, I just hopped over the fence and I went straight to the road that our school is located on - and as I got there there was just Swat cars and police units, police vehicles just flying by, helicopters over the top of us."

Image copyright EPA Image caption Students were reunited with parents at a nearby "staging area" in Coral Springs

Caesar Figueroa, a parent, told CBS News his daughter was hiding in a closet when she called him.

He told the news outlet that he told her not to call him because he did not want the gunman to hear her voice.

"It's the worst nightmare not hearing from my daughter for 20 minutes, it was the longest 20 minutes of my life," Mr Figeuroa said.

A teacher told WSVN that she hid in a closet with 19 students for 40 minutes - and that the school underwent training for such a situation six weeks ago.

What's the reaction been?

Florida Senator Marco Rubio tweeted that the shooting was "designed & executed to maximize loss of life".

But he said that it was too soon to debate whether tighter gun laws could have stopped it.

"You should know the facts of that incident before you run out and prescribe some law that you claim could have prevented it," he told Fox News.

Florida Governor Rick Scott said the shooting was "pure evil", but also refused to be drawn into a discussion about gun control.

"There's a time to continue to have these conversations about how through law enforcement... we make sure people are safe," he said.

President Donald Trump tweeted his condolences.

Congressman Ted Deutch, the district's representative, tweeted: "I'm sick about this news from home. Just spoke with the sheriff. This is devastating."

Media playback is unsupported on your device Media caption Sandy Hook Senator: 'This happens nowhere else'

How do previous school shootings compare?

Wednesday's attack is at least the 18th shooting in the US this year on or around school premises, according to research by Everytown for Gun Safety.

Media playback is unsupported on your device Media caption A guide to the weapons available in the US and the rate at which they fire

Since 2013, there have been 291 reported school shootings in America, which averages out to about one per week.

This is the worst shooting since 2012, when gunman Adam Lanza attacked Sandy Hook Elementary School in Newtown, Connecticut.

He shot dead 20 young children and six adults before killing himself.