Police say the 19-year-old confessed to killing 17 people in one of the deadliest school shootings in US history.

A 19-year-old man has confessed to the shooting at a Florida high school that resulted in the deaths of at least 17 people, including students and adults, police say.

Nikolas Cruz "stated that he was the gunman who entered the school campus armed with an AR-15 and began shooting students that he saw in the hallways and on the school grounds", a police document, released on Thursday, reads.

The teenager was also charged with 17 counts of premeditated murder on Thursday.

Police say Cruz, armed with a semiautomatic rifle, gas mask, "multiple magazines" of ammunition and smoke grenades, began his shooting rampage at the Marjory Stoneman Douglas High School in Parkland, Florida just before dismissal on Wednesday.

At least 17 people were killed and 15 others injured.

According to police documents, Cruz stated that "he brought additional loaded magazines to the school campus and kept them hidden in a backpack until he got on campus to begin his assault".

Police say the teen also admitted that he left the scene "as students began to flee the campus on foot" and he "decided a plan to discard the AR15 and vest with the additional magazines so he could blend into the crowd".

He was arrested "without incident" about an hour after the attack in a neighbouring town, police say.

Here's what we know so far about Nikolas Cruz:

Cruz was expelled from Marjory Stoneman Douglas High School for "disciplinary reasons". Authorities have not specified when he was expelled or the details of the expulsion.

He has been charged with 17 counts of premeditated murder.

He confessed to being armed with a semiautomatic AR-15 rifle and multiple magazines of ammunition.

According to police documents, he left the scene as a crowd of students fled.

Police told reporters on Thursday that after the shooting Cruz went to a Walmart, where he bought a drink at a Subway restaurant, and then to a McDonalds.

Police say Cruz's social media posts are "very, very disturbing".

Investigators are looking into a possible connection to a white supremacist group in Florida. The leader of Republic of Florida group confirmed to the Associated Press that Cruz was a member. Police have said that a connection to the group is "not confirmed".

Students who say they knew Cruz have told local media that the teenager was a "loner" and often showed off photos of guns.

According to local media, the FBI was warned about a post on YouTube last September by someone with the name Nikolas Cruz that said: "I'm going to be a professional school shooter". A video blogger alerted the FBI to the comment and was then questioned by the agency. According to local media, the FBI did not alert local police about the comment. Investigators are trying to determine the true identity of the individual who posted the comment.