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 legally bought the semiautomatic at a Broward County gun shop last February, law enforcement officials who weren’t authorized to discuss the matter publicly told the Associated Press.

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, they are prohibited from possessing a firearm under federal law.

Florida Gov. Rick Scott told 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.

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.

This was an issue 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 health issues.

FBI Special Agent Rob Lasky said his agency got 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.

“We do not know if it’s the same person,” Lasky said. “We’re looking at it again.”

Cruz was equipped with a gas mask, smoke grenades and magazines of ammunition when he opened fire Wednesday with the rifle, 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 during the last 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 possible mental health issues of the shooter but said Congress had passed legislation to deal with that issue.

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

Experts say national tragedies like 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 issues that might help curb gun violence, including bolstered school security measures. 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 side of the gun debate might find middle ground.

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