Zachary Cruz, Nikolas Cruz’s brother, walks into court on Thursday in Fort Lauderdale, Fla. (Susan Stocker/South Florida Sun-Sentinel/AP)

The brother of Parkland shooting suspect Nikolas Cruz has pleaded “no contest” to trespassing at Marjory Stoneman Douglas High School more than a month after 17 students and staff members were killed in a mass shooting on the campus.

Zachary Cruz, 18, pleaded no contest Thursday, meaning that he is not disputing the charge. He was sentenced to time served as well as six months’ probation, according to a spokeswoman for the state attorney’s office in Broward County, Fla.

During probation, Cruz is prohibited from possessing firearms. He is also forbidden from returning to the school or contacting the victims or their families.

His attorney could not immediately be reached for comment Thursday by The Washington Post.

Zachary Cruz was arrested for trespassing March 19 after he was seen skateboarding through the campus where dozens of students and staff members had been killed and injured only weeks before in a shooting rampage. When questioned by authorities, he said he wanted to “reflect on the school shooting and soak it in,” according to his arrest report. To do so, he bypassed the locked doors and gates of the campus and ignored previous warnings by school officials to stay off the property, officials said.

He was taken into custody and held on a $500,000 bond, as well as ordered to undergo a psychological evaluation.

Assistant Broward State Attorney Sarahnell Murphy had argued that Cruz “has all the same flags present as his brother,” according to the Miami Herald.

In addition to the trespassing charge, the Broward County Sheriff’s Office had petitioned a judge to revoke Cruz’s right to own or possess a firearm under a new law passed this month. His attorney, Joseph Kimok, argued that prosecutors were being overly harsh on his client simply because of his brother. Nikolas Cruz was indicted by a grand jury this month on 34 counts of premeditated murder and attempted murder in the shooting, which is the second-deadliest at a U.S. public school.

Following Thursday’s plea agreement, Kimok said it was “a very good day for Zachary Cruz.”

“His 10-day nightmare is over. This unlawful and unconstitutional confinement has ended. He’s going home, which is where he belongs,” Kimok told reporters, according to the Palm Beach Post.

“It’s a frustrating day for justice,” he added. “Zachary Cruz pleaded to this case in order to get out of jail, and the reason that he was in jail is because he had a half-million-dollar bond the judge set on a trespass case. Because of that half-million-dollar bond, he spent the last 10 days behind a locked door in a jumpsuit.

“The fundamental premise of our criminal justice system is that you are innocent until proven guilty. But when a judge sets a bond so high that you have to plead guilty in order to get out of jail, that premise is destroyed. That’s what happened in this case, that’s what happens in this courthouse, and in courthouses around the country every single day.”

Read more:

Parkland shooting suspect’s brother has ‘all the same flags,’ prosecutors say after arrest