Fifty-four people were admitted to hospital, the city's police chief Asep Edi Suheri told a news conference, with the injuries ranging from minor to serious and including burns. BBC reported.
The suspect is a 17-year-old student who is currently in surgery, officials told reporters.
The Jakarta Metropolitan Police continues to investigate the suspect's background and the possible motive behind the incident, which occurred at around 12:15 local time (05:15 GMT) in Kelapa Gading, a district in North Jakarta.
A
bomb disposal team has been deployed to the state-run high school complex to collect evidence and ensure there are no other explosive devices.
Authorities said three people had suffered serious injuries and 17 others came away with minor injuries. Others have been treated and discharged, local media reports.
A pupil at the school alleged to Indonesia's government-owned news agency Antara that a homemade bomb had been brought in by a student who had often been bullied by other students.
Other pupils told Indonesian news outlets that the suspect was a "loner" who often made drawings depicting violence, and who had been found lying on the ground following the explosion.
A cook at the school described seeing white smoke coming from the mosque and broken windows after the "massive" blast.
"Our hearts were beating fast, we couldn't breathe," she told the Reuters news agency.
A high-ranking Jakarta Metropolitan Police officer confirmed the presence of two objects resembling firearms at the scene.
Images from Antara suggest one of the objects appeared to be a submachine gun and another looked like a pistol.
The submachine gun-type object appears to be inscribed on its barrel with: "14 words. For Agartha."
On its body, it says: "Brenton Tarrant. Welcome to Hell."
Brenton Tarrant is the perpetrator of a 2019 mass shooting at a mosque and Islamic centre in Christchurch, New Zealand, that killed 51 and injured dozens of others.
A minister who visited the scene later on Friday sought to dispel suggestions that weapons were present at the site, telling CNN Indonesia what had been pictured "turned out to be a toy gun, not a real gun".
Lodewijk Freidrich Paulus also called on the public not to presume the explosion was a "terrorist act" as investigators were still combing over the scene.
Another object found at the site was a dark green belt for storing gun cartridges.
Indonesia has the world's largest Muslim population.