The children, some of them tied up, were rescued by police through smashed windows before flames destroyed the vehicle, and no one was seriously injured.
After police arrived, the driver allegedly doused the vehicle with an inflammable liquid and shouted: “No one will survive today.”
The suspect, a 47-year-old Italian citizen originally from Senegal, has been arrested.
He told authorities he wanted to vindicate Europe-bound migrants who have died in the Mediterranean Sea but did not plan to hurt anyone.
However, prosecutors said the man, identified as Ousseynou Sy, made preparations that showed his actions were premeditated.
He allegedly bought a canister of petrol and restraints a day before the attack on Wednesday.
He also sent a video to friends in Italy and Senegal indicating plans for bold action, with the message “Africa, Rise up”, prosecutors said.
Mr Sy was being investigated on suspicion of kidnapping, intention to commit a massacre, arson and resisting law enforcement, with terrorism as an aggravating circumstance since the event caused panic.
Prosecutors said they have found no evidence of Islamic radicalisation or ties to extremists, saying it appeared the bus driver acted alone.
Chief prosecutor Francesco Greco praised the Carabinieri, Italy’s military police force, for moving swiftly to block the bus and remove the children.
“They carried out an operation that we see in films with special agents,” Mr Greco said.
‘’Thank goodness, because by then the intent to massacre had ignited, and the man was starting to set fire to the bus, as he did.”
Milan’s provincial Carabinieri commander, Luca De Marchis, told broadcaster Sky TG24 the bus was transporting two classes between school and a nearby gym in Cremona province, some 40km (24 miles) from Milan.
The driver threatened the passengers, telling them “no one would survive today” as he commandeered the bus, Mr De Marchis said.
Italian news agency Ansa quoted one of the students as saying the driver took everyone’s phones and ordered the chaperones to bind the students’ hands with cable ties, threatening to spill gas and set the bus ablaze.
Ansa said the chaperones only loosely bound several students’ hands with the zip ties, not everyone’s.
One of the students described his terror in an interview with La Repubblica TV, his face obscured due to his age. His name was not given.
“We were all very afraid because the driver had emptied the gas canister onto the floor [of the bus]. He tied us up and took all the telephones so we could not call the police,” the student said.
“One of the telephones, belonging to a classmate, fell to the ground, so I pulled off the handcuffs, hurting myself a bit, and went and picked it up. We called the Carabinieri and the police.”
Authorities said that an adult called an emergency operator, while one of the students called a parent, and they alerted authorities who set up roadblocks.
The bus was intercepted on the outskirts of Milan by three Carabinieri vehicles, which were able to force it into the guardrail, Mr De Marchis said.
“While two officers kept the driver busy – he took a lighter and threatened to set fire to the vehicle with a petrol canister on board – the others forced open the back door, breaking two windows,” Mr De Marchis said.
While the evacuation was still underway, the driver started the blaze.
Mr De Marchis credited the officers’ “swiftness and courage” for getting out all the children and their teachers “with no tragic consequences”.
Some of the passengers were treated at a hospital, mostly for cuts and scratches related to the evacuation, he said.
Prosecutors confirmed Mr Sy, who became an Italian citizen in 2004, had been convicted in 2007 and 2011 of drunken driving and sexual molestation of a minor. Sky TG24 said the driver had worked for the bus company for 15 years without any employment-related issues.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies