The brother of the suspected Florida high school gunman has pleaded no contest to trespassing on the campus where the deadly rampage happened and was sentenced to time served and six months of probation.

Judge Melinda Kirsch Brown also ordered Zachary Cruz to enroll in therapy, wear an ankle bracelet and said he cannot possess firearms or ammunition.

The 18-year-old was arrested on March 19 after police found him skateboarding at Marjory Stoneman Douglas High after school.

Administrators had told him not to come on campus.

Cruz is the younger brother of Nikolas Cruz, who is accused of killing 17 students and staff members at the school on February 14.

Nikolas Cruz is accused of killing 17 students and staff members (Amy Beth Bennett/South Florida Sun-Sentinel via AP, Pool)
Nikolas Cruz is accused of killing 17 students and staff members (Amy Beth Bennett/South Florida Sun-Sentinel via AP, Pool)

The Cruz brothers attended Stoneman Douglas but did not graduate.

According to an arrest report, Zachary Cruz told officers he came to the school to “reflect on the school shooting and soak it all in”.

He did not resist arrest and the report made no mention of any weapons.

Joseph Kimok, a lawyer for Zachary Cruz, read a statement from him saying he was sorry if he scared anyone by visiting the school. He also said Zachary Cruz had never been told to stay away from the school.

The judge also said Zachary Cruz must be tested to make sure he is not consuming drugs or alcohol and must stay at least one mile from the school.

Nickolas and Zachary Cruz shared the same biological mother but had different fathers.

Both were adopted at very young ages by Roger and Lynda Cruz.

Lynda Cruz died in November and their father died some years earlier.