The suspect in a Florida school shooting bought the AR-15-style rifle used in the attack legally a year ago, authorities said Thursday.

Nikolas Cruz, 19, is charged with murdering 17 people at Marjory Stoneman Douglas High School, where he had been expelled for fighting, according to authorities.

Cruz lawfully bought the semiautomatic rifle last February, according to Peter Forcelli, special agent in charge of the Miami office of the Bureau of Alcohol, Tobacco, Firearms and Explosives. 

The gun, a Smith & Wesson M&P 15 .223, was purchased at Sunrise Tactical Supply, according to the Associated Press.

This photo posted on the Instagram account of Nikolas Cruz shows a weapon being held. Cruz was charged with 17 counts of premeditated murder on Feb. 15, 2018, the day after opening fire with a semi-automatic weapon in the Marjory Stoneman Douglas High School in Parkland, Fla.
AP

Federal law allows people 18 and older to legally purchase long guns, including this kind of assault weapon. With no criminal record, Cruz cleared an instant background check via the FBI criminal database.

If somebody is adjudicated mentally defective or has been committed to a mental institution, he is prohibited from possessing a firearm under federal law.

Florida Gov. Rick Scott said at a news conference Thursday that he would discuss with the Legislature next week increasing funding for mental-health services and keeping guns out of the hands of the mentally ill.

“If somebody is mentally ill, they can’t have access to a gun,” Scott said.

Melisa McNeill, his public defender, described Cruz in his initial court appearance Thursday as a "broken child" who suffered brain-development problems and depression.

Gun buyers are seldom turned down because of mental illness. From 1998 to 2014, the FBI rejected 16,669 potential gun buyers because a background check found a mental health adjudication, about 1.4% of the roughly 1.2 million background checks that resulted in a denial.

Mental health entered the debate after the 2007 Virginia Tech shooting. The gunman in that case had been treated at a Virginia hospital on the grounds that he might be a danger to himself or others. He was nonetheless able to pass a background check. After that, a lot of states moved to supply the FBI and their own background check databases with records about people with mental illness.

Rob Lasky, FBI special agent in charge of the Miami division, said his agency received a tip in September about a comment made on a YouTube video that said, “I’m going to be a professional school shooter.”

The FBI reviewed databases and couldn’t track down who made the statement, he said.

“There was no connection found to South Florida,” Lasky said.

More on the Florida school shooting:

Florida school shooting suspect charged with premeditated murder

What we know about Nikolas Cruz, attack at Parkland high school

'My school is being shot up and I am locked inside!': Chaos in Florida school

Why the AR-15 keeps appearing at America's deadliest mass shootings

Cruz was equipped with a gas mask, smoke grenades and magazines of ammunition when he opened fire Wednesday, police said.

"An AR-15 is not for hunting, it's for killing," Sen. Bill Nelson, D-Fla., said on the Senate floor Thursday.

After Cruz’s mother died Nov. 1, he moved in with a friend’s family around Thanksgiving, the family’s lawyer, Jim Lewis, told AP. The family was aware of the rifle and made him keep it locked in a cabinet, but he had a key, he said.

Photos posted in an Instagram account linked to Cruz show a half-dozen weapons displayed on a mattress and a box of ammunition.

Lewis said the family wasn’t aware of other weapons in the cabinet. The family is cooperating with authorities and had no idea he was planning the shooting, Lewis said.

They had “no indication that anything severe like this was wrong,” Lewis said. “He totally kept this from everybody.”

Cruz had been part of the Junior Reserve Officer Training Corps while attending the school as a freshman, and he wore one of the group’s shirts Wednesday. But current members of JROTC said the uniforms have changed, and Cruz’s shirt didn’t match theirs.

“If he wore the uniform, he would have been more successful,” said Colton Haab, 17, who attends the school.

Gun control advocates are calling for tougher measures.

Senate Minority Whip Richard Durbin, D-Ill., said the Florida shooting came on the 10th anniversary of a shooting at Northern Illinois University that killed five people and injured 17.

“A numbness is setting in,” Durbin said on the Senate floor. “Schools and colleges are doing the best they can to prepare and protect their students. But is Congress doing all that it can to keep our nation’s students safe from gun violence? Not even close.”

Gabrielle Giffords, a former member of the House who survived a shooting, urged Congress to act after three of the deadliest mass shootings in U.S. history in the past five months.

House Speaker Paul Ryan, R-Wis., declined Thursday to support a proposal made by Democrats to create a special committee to study gun violence. He made reference to the shooter's possible mental illness but said Congress had passed legislation to deal with that question.

“This is not the time to jump to some conclusions," Ryan said.

Experts say national tragedies such as Wednesday’s rarely lead to changes in federal gun laws because people burrow further on their own side of the fence. States with tight gun restrictions squeeze tighter. States with loose laws open up more.

"In the wake of these shootings, reactions are polarized, and people tend to double down,” said Timothy Lytton, associate dean for research and faculty development at Georgia State’s School of Law.

"States are likely to do more of the same, while Congress is likely to be deadlocked on the issue of guns," he said. 

He pointed to less politically toxic solutions that might help curb gun violence, including bolstered school security. In many parts of the country, metal detectors are commonplace.

If lawmakers start "thinking about security of schools the same way we think about it in other places,” Lytton said, people on both sides of the gun debate might find middle ground. 

Contributing: Brett Murphy, USA TODAY Network; Emily Bohatch, The (Stuart, Fla.) News; Alan Gomez, USA TODAY