Zachary Cruz, the brother of the man who killed 17 students and staff at Marjory Stoneman Douglas High School, was arrested Monday for trespassing at the Parkland school, officials said.

The Broward Sheriff’s Office said Zachary, 18, rode his skateboard at 4:30 p.m. across the campus where his older brother, Nikolaus, went on a shooting spree with an AR-15 rifle.

Zachary Cruz told deputies he visited the school “to reflect on the school shooting and to soak it in,” according to the arrest report. He had been warned by school officials to keep away from the school.

“Cruz surpassed all locked doors and gates” to get onto the campus, the arrest report said.

Nikolas Cruz, 19, has confessed to the Feb. 14 school shooting and faces the death penalty for the murder of 17 and the attempted murder of 17 others.

Zachary Cruz has been living with a family friend, Rocxanne Deschamps, in Lantana since the death of his mother in November.

He has no ties to Broward County, the arrest report said.

The Cruz brothers were adopted at birth by Lynda and Roger Cruz from the same mother. The couple had arranged the private adoptions through an attorney.

Roger Cruz suffered a heart attack and died when the boys were very young. Lynda Cruz was hospitalized with pneumonia and died in November.

Throughout his childhood, Nikolas Cruz was diagnosed with a string of disorders and conditions: depression, attention deficit hyperactivity disorder, emotional behavioral disability and autism, records from the state Department of Children and Families show. His mom told sheriff’s deputies he also had obsessive-compulsive disorder and anger issues.

In January 2017, shortly after Cruz inexplicably stopped undergoing mental health treatment, Lynda Cruz sold the expansive family home in Parkland, and the trio moved into a smaller condo.

Nikolas Cruz assaulted someone at Stoneman Douglas that month and was ejected soon after.

His brother, Zachary,, told Palm Beach County Sheriff’s deputies that “he and his friends, when they were younger, had bullied Nikolas, which he now regrets ever doing,” the agency’s report says. The deputy wrote that “Zachary wishes that he had been ‘nicer’ to his brother” and that there may be resentment between the two “as Nikolas may have been the favored brother.”

When Nikolas Cruz appeared shackled and handcuffed before a judge at an arraignment hearing last week, his younger brother was seated in the courtroom. A tear slid down Zachary Cruz’s cheek.