The boy, 17, had been arrested on suspicion of conspiring to murder the headmaster of the Enskede Gård Gymnasium school. Prosecutors decided on Sunday that he should be released.
“He has been taken to a clinic,” said Catharina Nordin of Stockholm Police.
Another boy, aged 16, remains in custody. Prosecutors will decide on Monday whether to formally remand him.
Both boys remain under suspicion of conspiracy to murder.
The two teenagers were arrested on Friday morning after teachers reported concerns that they could pose a threat. They were said to be inspired by last week’s massacre in Jokela, Finland, and the 1999 shootings at Columbine High School, Colorado.
The boys’ computers have been examined by police over the weekend.