Police said the blasts occurred during Friday prayers at a mosque within SMA 27, a state high school located in a navy compound in the Kelapa Gading area of northern Jakarta.
Jakarta city police chief Asep Edi Suheri told reporters that 55 people had been taken to hospitals with injuries ranging from minor to severe, including burns.
Deputy House Speaker Sufmi Dasco Ahmad, who visited one of the hospitals, said a 17-year-old identified as the suspected perpetrator was undergoing surgery.
Witnesses told local television stations they heard at least two loud explosions around midday as the sermon began.
Authorities have launched an investigation into the incident.