Suffolk Police said that officers were called to Friends Walk in Kesgrave, England, around half a mile from Kesgrave High School, just after 8.40am on Monday.
The force said that just over two hours later, at 10.55am, a boy was arrested five miles away in Westwood Avenue in Ipswich on suspicion of attempted murder.
The suspect, also a 15-year-old boy, is from the Woodbridge area and is being questioned in police custody.
The victim sustained serious injuries and was airlifted to Addenbrooke’s Hospital in Cambridge where he is receiving medical treatment.
Police said he remains in a critical condition.
Kesgrave High School said on Twitter that one of its Year 11 students had been involved in a serious incident on their way to school, but that pupils at the site were safe.
Police are treating the shooting as an isolated incident, and there is thought to be no wider threat to the school or local community.
Assistant Chief Constable Rob Jones said: “Our immediate thoughts at this time are with the victim of this horrific incident and his family, who we are providing full support to.
“I understand this attack will have caused a great deal of alarm and distress to the people of Kesgrave and the surrounding area, but we are now satisfied that this was an isolated incident and there is no wider threat to the local community.
“Our priority is to keep everyone safe and I would like to stress that crimes such as this are extremely rare in Suffolk.
“This is an area with a number of schools nearby and going forward, parents should not be concerned about dropping off or collecting their children.
“However, there will be additional officers on patrol in Kesgrave to provide reassurance and I would encourage anyone with any concerns or information to speak to them.
“Finally, I once again urge anyone with information about this incident to contact us without delay.”
Friends Walk and Through Jollys were cordoned off and there was a partial closure on Ropes Drive, as scenes of crime officers in white forensic suits carried out investigations.
The owner of an animal shelter in Kesgrave said a man believed to be the suspect in the shooting had been hiding in his back garden, but escaped before armed police officers arrived.
The resident, who asked not to be named, told the PA news agency the man “looked like he hadn’t had a haircut for a while”.
“I got woken up because my dogs were going absolutely ballistic at the back of the house,” he said.
“When I went to the back window to have a look there was a gentleman who looked like he was carrying something, at first I thought it was a bat or pole or something, and he went down behind my exotic animal enclosures.”
He added that the man had a hooded top over his arm concealing whatever he was carrying.
“I’ve got no neighbours directly and I’ve got a woodland at the side… I didn’t see where he went.”