(CNN) Long before he slaughtered 17 people at the South Florida high school he once attended, Nikolas Cruz had a disturbing way of introducing himself.

"Hi, I'm Nick," he used to say, according to an acquaintance interviewed by CNN. "I'm a school shooter."

Cruz posed with guns and knives in photos posted on Instagram and made a chilling online comment about a mass shooting carried out in New York this summer.

"Man I can do so much better," he wrote.

His hints of future violence are part of an emerging portrait of the 19-year-old Broward County man who carried out the nation's most recent mass killing on Valentine's Day with an AR-15-style rifle he legally purchased last year.

Also part of that portrait are what Cruz's attorneys referred to as a chronic battle with mental illness and depression exacerbated by the recent death of his adoptive mother, which left him without parents.

A defense attorney referred to him on Thursday as "a broken child."

CNN pieced together this profile of Cruz based on interviews with people who knew him, court documents, and an analysis of Cruz's online writings and videos.

Cruz was adopted at a young age by Roger and Lynda Cruz. Roger died years ago. Lynda died last fall, following an illness. He was taken in by the parents of a schoolmate, according to that family's attorney.

Police say Nikolas Cruz has confessed to the shootings.

His mother's death capped troubled high school years that ended with his expulsion from Marjory Stoneman Douglas High School.

A former classmate, who grew up with Cruz and attended school with him since the sixth grade, said Cruz would sometimes introduce himself as a "school shooter."

"He was very, very strange," the student, who asked not to be named, told CNN. "Like if there was someone to shoot up a school, it would be him."

Another schoolmate, Brody Speno, also recalled peculiar behavior.

"Something wasn't right about him," Speno recalled. "He was off."

Speno said he knew Cruz from elementary school until his family moved away a couple of years ago. He described him as "an evil kid" who was "always getting in trouble."

He recalled Cruz stealing peoples' mail, throwing rocks at cars and tormenting animals. He described one incident in which he said Cruz "cornered a squirrel and was trying to throw rocks at it and kill it."

He said police were called to the house "almost every other week."

Documents obtained by CNN show that law enforcement officers responded to Cruz's house on 39 occasions over a seven-year period. No police reports were immediately available for those calls so it was not possible to determine whether Cruz was involved.

JUST WATCHED Former neighbor: He carried a pellet gun Replay More Videos ... MUST WATCH Former neighbor: He carried a pellet gun 01:44

Another neighbor, concerned about Cruz "acting weird" in the backyard took video of him dressed in boxer shorts shooting what appeared to be a BB gun. The man, who asked not to be identified, said his wife watched Cruz shooting bottles, cans and buckets over and over again for two days in October 2017. He sometimes pointed the gun toward their window, the man said.

"She got scared. I got scared," he said.

Some of Cruz's most alarming behavior was exhibited online.

He had two Instagram accounts featuring weapons and photos. In one picture he is wearing a kerchief over his face and a Make America Great Again hat. Another photo is taken from behind a gun sight looking out the window.

There are online posts in which he writes:

"I wanna shoot people with my AR-15" and "Im going to be a professional school shooter"

The latter post, made with Cruz's name attached to it, was reported to the FBI. But FBI officials said they were unable to determine who was responsible.

This summer a Nikolas Cruz made an online comment in response to a story about a disgruntled doctor in New York who used an AR-15 to shoot seven people, killing one and wounding six others.

"Man, I can do so much better," he wrote.

The comment was linked to one of Cruz's YouTube accounts, which have since been removed in the wake of Wednesday's shooting.

Not everyone who crossed paths with Cruz saw reason for concern. The attorney for the family who took him in after his mother's death said they were aware of trouble he'd earlier had at school and saw signs of depression.

But, "they didn't see any danger," Jim Lewis said of the unidentified family. "They are horrified just like everybody else."

Lewis described Cruz as "a smaller kid" and said there was an indication "there may have been some bullying going on."

Hunter Vukelich, a former manager at a Dollar Tree store where Cruz worked while he pursued a GED, said he saw nothing alarming about the young man who would ride his bike back and forth to the job.

"You could tell he was a little off," Vukelich said, but not dangerous.

"He was always very nice, shy, head usually down," he recalled.

According to authorities, Cruz was initially able to leave the crime scene at the school by blending in with students fleeing campus in the wake of the massacre. He went to a Walmart and a McDonald's before being found by police and taken into custody. He has since confessed to the killings, according to court documents.

Gordon Weekes, one of Cruz's public defenders, said he believed Cruz has been placed on suicide watch.

He said the defense team would be exploring mental health issues and "the possibility of autism."

"We are trying to save this young man's life," he said.