After 10 days in custody Zachary Cruz, whose brother is charged in the murder of 17 people at a Florida high school last month, pleaded no contest Thursday to trespassing on the school's grounds and was sentenced to time served.

Cruz, 18, also was ordered to complete six months of probation, to attend therapy and to wear a GPS ankle monitor. Cruz was barred from using alcohol or possessing firearms.

Not only does the plea deal prohibit Cruz from coming within a mile of Marjory Stoneman Douglas High School — the site of the Feb. 14 massacre — but he is also not allowed on the campus of any school where he is not enrolled.

Cruz was arrested March 19 after police found him skateboarding at the school, having bypassed locked doors and gates, according to police.

Cruz said his intentions were to "reflect on the school shooting and to soak it in," according to the detective who interviewed him.

In a prepared statement read to the court, Cruz's court-appointed attorney, Joseph Kimok, said that his client "did his best to cope" in the aftermath of his mother's death in November and the killing spree in February.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.