Some of the children were tied up during the 30-minute ordeal, which saw the bus slam into a car but was brought to an end by police after one of the children was able to call for help. No one was seriously injured.
"It is a miracle, it could have been carnage. The police were outstanding, blocking the bus and getting the children off," said Milan prosecutor Francesco Greco.
Photos showed the burnt-out shell of the bus and the car, which were travelling on a road near Milan.
Driver Ousseynou Sy - a 47-year-old Italian citizen of Senegalese origin - explained under questioning that he wanted "to draw attention to the consequences of migration policies", according to his lawyer.
Drunk Russian man detained after failed attempt to hijack plane
The 51 students in year two of secondary school in Crema were coming back from a sports outing accompanied by three adults when the driver abruptly changed route, announcing he was taking them all hostage.
"No one is getting out of here alive," he said, according to several of the students.
A dozen children and two of the adults were taken to hospital for smoke inhalation while the arrested driver also needed treatment for burns to his hands.
The Milan police anti-terrorism unit has been charged with investigating the hostage-taking which lasted a little over 30 minutes.
However Sy had no links with Islamic terrorism, Alberto Nobili, head of counter-terrorism at the Milan public prosecutor's office, told a press conference, saying he "acted as a lone wolf".
Planning the hijack over several days, Nobili said Sy "wanted the whole world talking about his story". He posted a video on Youtube to explain his actions and say “Africa - arise", directed at family and friends in Crema but also in Senegal.
The driver, armed with two canisters filled with petrol and a cigarette lighter, threatened the children, took their telephones and told the adults to tie them up with electric cable.
"I lost three children at sea," he said, according to one of the rescued children.
"He threatened us, said that if we moved he would pour the petrol and set it alight. He kept saying there were so many people in Africa who kept dying and that it was the fault of (deputy prime ministers) Di Maio and Salvini," a rescued girl told Italian media.
Luigi Di Maio and in particular Matteo Salvini, who is also interior minister, have taken a hard line against migrants since they formed a populist coalition government in June, including trying to close Italian ports to ships that rescue migrants in the Mediterranean.
"Then the police arrived and saved us," the rescued girl said.
Prosecutor Greco said the man kept two of the children close to him, brandishing the lighter. The bus crashed into a car, from which a father and son escaped before it burst into flames.
One of the children managed to pick up a phone that had been dropped and call their parents who in turn phoned the police.
"I hurt my hands a bit picking it up ... we were all terrified," the boy told Italian television.
Police blocked the bus in the street and broke open the back windows to get the children out before the vehicle went up in flames.
Would-be Bangladesh hijacker was carrying fake gun: official
"The children were banging on the windows, calling for help," said Roberto Manucci, one of six carabineri at the scene.
Thousands of migrants have crossed from North Africa to Italy, many of them losing their lives on the dangerous journey.
"I want to put an end to it, I want to stop the deaths in the Mediterranean," several reports cited the driver as saying.
Sy had been an Italian citizen since 2004, with reports saying was divorced from his Italian wife and has two teenage children.
The interior ministry said in a statement that the driver had been previously caught driving while drunk and had sexually assaulted a minor. It gave no dates for the alleged offences.
Interior ministry sources said the minister was looking at withdrawing the driver's Italian citizenship, a move made possible by tough anti-migrant legislation adopted late last year.
Earlier on Wednesday Salvini said his immigration policies has saved thousands of lives. "Fewer departures, fewer arrivals, fewer deaths," he said.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ