MOUNT VERNON, Wash. — The suspect accused of killing five people at a Macy’s department store confessed to police, court documents said, but his motive remained a mystery Monday as a portrait emerged of him as a mentally troubled young man whose parents said they were trying to help him.

Arcan Cetin, 20, appeared in court and was officially charged with five counts of first-degree premeditated murder following his arrest over the weekend for the rampage at the Cascade Mall in Burlington, north of Seattle.

Cetin appeared to express no emotion and said only “Yes, your honor” when asked by a judge if he understood his rights. Bail was set at $2 million and his lawyer said nothing about his client in court and did not speak with reporters.

The hearing followed a terrifying weekend that began Friday night when police say Cetin stormed into the mall and killed five people, leaving Burlington residents panicked for nearly 24 hours until authorities arrested him.

Cetin, described by acquaintances as socially awkward, has a criminal record going back at least two years and one of his neighbors said he unnerved her so much that she kept a stun gun near her front door.

Cetin after his arrest admitted when interviewed by detectives he was the man captured on security video carrying a Ruger rifle inside the mall, “and he did bring the rifle into Macy’s and shot all five victims,” court documents released ahead of Monday’s hearing said.

He shot all five victims in one minute and left the rifle with a 25-round magazine on a cosmetics counter before fleeing, police said in court documents. Four died at the scene and one died in the hospital.

The victims ranged in age from a teenage girl to a woman in her 90s.

Authorities have declined to reveal details about their investigation into the motive for the shooting, but Cetin’s stepfather David Marshall told reporters after the hearing that his stepson “has mental health issues” without elaborating.

“The only thing that we want to say at this time is that we both are totally devastated by what happened,” said Marshall, who attended the hearing with Cetin’s mother.

The court documents appeared to paint a picture of Cetin’s stepfather and mother trying to keep their son on track despite his suffering from an unspecified illness and criminal charges he faced for allegedly assaulting Marshall. Cetin came to the U.S. from Turkey and is a permanent legal resident, authorities have said.

Cetin faced charges last year for allegedly assaulting his stepfather after he caught Cetin smoking marijuana inside the house, according to court records.

He was told by a judge last December not to possess a gun but Cetin’s stepfather urged the judge not to impose a no-contact order, saying his stepson was “going through a hard time,” the records said.

Cetin had been diagnosed with anxiety and depression and has taken unspecified medications in the past, the records show.

He eventually moved out of his parents’ home and the stepfather told detectives after the shooting that he and his wife had helped Cetin with his rent.

Cetin said his father bought him a laptop, according to the court documents released Monday. His mother visited him regularly at his new apartment and last saw him Wednesday, the documents said.

Despite their falling out, Cetin ate with his stepfather on the day of the shooting before leaving around 4:30 p.m. to go to work, according to the documents.

Less than three hours later, police said in court documents, surveillance video showed Cetin enter the mall through a fast food restaurant, walk through the shopping center and leave through the Macy’s women’s department exit.

He then moved his car closer to the Macy’s entrance and took a rifle out of the car’s trunk, the documents said.

Within moments, surveillance cameras in Macy’s captured the shooter entering through the same women’s department — this time with a rifle.

Cetin first shot and killed a teenage girl near some clothing racks and then walked to the cosmetics counter where he shot a man and three women, the documents said.

Cetin was arrested late Saturday in Oak Harbor, about 30 miles from the mall, by a sheriff’s deputy who recognized him. Cetin’s stepfather told detectives that his Ruger rifle and .22-caliber ammunition were missing, documents said.

Police interviewed the suspect’s former girlfriend and said Sunday night she “has an employment history at Macy’s, but not at the Burlington Mall location.” They did not identify her.

Amber Cathey, 21, lived in an apartment next to Cetin for three months and said she was so frightened of him that she kept a stun gun handy and complained to apartment management. She said she blocked him on Snapchat after he sent her a photo of his crotch.

More details emerged Monday about the victims who police have said they will not identify until Tuesday.

The man who was killed, Chuck Eagen, was set to retire next year after working 41 years for Boeing, his aunt Carol Thrush said in an interview.

Thrush described Eagan, 61, as kind and generous.

“He traveled with Boeing all over the world, doing repairs on airplanes,” said Thrush, 77.

Flaccus reported from Portland. Associated Press writers Lisa Baumann in Seattle, Phuong Le and Gene Johnson in Seattle; Manuel Valdes in Mount Vernon, Washington; and Kimberlee Kruesi and Keith Ridler in Boise, Idaho, contributed to this report