MIAMI (AP)  Officials were so concerned about the mental stability of the student accused of last month”s Florida school massacre that they decided he should be forcibly committed.

But the recommendation was never acted upon.

A commitment under the law would have made it more difficult if not impossible for Nikolas Cruz to obtain a gun legally.

Cruz is accused of the shooting rampage that killed 14 students and three school employees at Marjory Stoneman Douglas High School in Parkland on Feb. 14. In addition, 17 people were wounded.

But more than a year earlier, documents in the criminal case against Nikolas Cruz and obtained by The Associated Press show school officials and a sheriff”s deputy recommended in September 2016 that Cruz be involuntarily committed for a mental evaluation.

The documents, which are part of Cruz”s criminal case in the shooting, show that he had written the word “kill” in a notebook, told a classmate that he wanted to buy a gun and use it, and had cut his arm supposedly in anger because he had broken up with a girlfriend. He also told another student he had drunk gasoline and was throwing up. Calls had even been made to the FBI about the possibility of Cruz using a gun at school.

The documents were provided by a psychological assessment service initiated by Cruz”s mother called Henderson Behavioral Health. The documents show a high school resource officer who was also a sheriff”s deputy and two school counselors recommended in September 2016 that Cruz be committed for mental evaluation under Florida”s Baker Act. That law allows for involuntary commitment for mental health examination for at least three days.

Such an involuntary commitment would also have been a high obstacle if not a complete barrier to legally obtaining a firearm, such as the AR-15 rifle used in the Stoneman Douglas massacre on Feb. 14, authorities say.

There is no evidence Cruz was ever committed. Coincidentally, the school resource officer who recommended that Cruz be “Baker Acted” was Scot Peterson  the same Broward Sheriff”s Office deputy who resigned amid accusations he failed to respond to the shooting by staying outside the building where the killings occurred.

David S. Weinstein, a former federal prosecutor, said that an involuntary commitment would have been a huge red flag had Cruz attempted to buy a firearm legally.

“If he had lied, hopefully the verification of the form would have pulled up the commitment paperwork,” Weinstein said.

The documents do not say why Cruz was not committed under the Baker Act or whether he may not have qualified for other reasons. The law allows a law enforcement officer such as Peterson to initiate commitment under the Baker Act.

An attorney for Peterson did not immediately respond to an email seeking comment Sunday.

Cruz, 19, is charged in a 34-count indictment with killing 17 people and wounding 17 others in the attack. He faces the death penalty if convicted, but his public defender Melisa McNeill has said he would plead guilty in return for a life prison sentence.

In the Henderson Behavioral Health documents, Cruz”s mother Lynda is quoted as saying she had fresh concerns about her son”s mental state after he punched holes in a wall at their home in Parkland. The clinicians at Henderson came to the home for interviews and said Cruz admitted punching the wall but said he did so because he was upset at a breakup with his girlfriend.

Cruz also admitted cutting his arm with a pencil sharpener.

After a Sept. 28, 2016 interview, the documents say Cruz “reports that he cut his arms 3-4 weeks ago and states that this is the only time he has ever cut. (Cruz) states that he cut because he was lonely, states that he had broken up with his girlfriend and reports that his grades had fallen. (Cruz) states that he is better now, reports that he is no longer lonely and states that his grades have gone back up.”

He also told the clinician he owned only a pellet gun and was not capable of doing “serious harm” to anyone.

The documents show that Cruz was very much on the radar screen of mental health professionals and the Broward County school system, yet very little appears to have been done other than these evaluations.

Other red flags have also surfaced, including calls to the FBI about Cruz”s potential to become a school shooter and numerous visits by county law enforcement officials to his home – both before his mother died in November and after, when he lived briefly with a family friend in Palm Beach County.

Again, very little was done.

It”s not clear from the documents who the recommendation was forwarded to or why it was not followed up.