Updated

Italian police on Wednesday rescued some 50 children taken hostage by their school bus driver, who doused the vehicle in petrol and set it alight, the authorities said.

"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.

Greco added that he could not rule out a terrorist connection in the incident.

The 51 students in year two of secondary school 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.

Armed with two canisters filled with petrol and a cigarette lighter, he menaced the children, took their telephones and tied them up with electric cable.

One of the children managed however to get a call through to their parents who in turned phoned the police.

They blocked the bus in the street and broke open the back windows to get the children out before the vehicle went up in flames.

"I want to put an end to it, I want to stop the deaths in the Mediterranean," several reports cited the driver as saying.

His motives were not immediately clear and the reference to the Mediterranean could be to the thousands of migrants who have crossed from North Africa to Italy, many of them losing their lives on the dangerous journey.

Reports said he was 47 years old, of Senegalese origin and had been a school bus driver since 2002.

About a dozen children and two of the adults were taken to hospital for smoke inhalation while the driver also needed treatment for burns to his hands.

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 legislation adopted late last year.