A packed bus crashed into a highway barrier and burst into flames Wednesday in southern India, killing 45 passengers who were locked inside the cabin after the driver escaped, officials said.

The driver, a bus cleaner and five passengers managed to escape through a window in the front of the overnight bus, according to the transportation minister of southern Andhra Pradesh state, Botsa Satyanarayana.

The other passengers were trapped inside the sleeper bus, which had an automatic locking system that could be controlled by the driver, said local police official Pradeep, who goes by one name.

Only three of the 45 charred bodies could be identified, state Information Minister D.K. Aruna said. "Authorities are gathering the DNA samples from the bodies" to use in identifying the rest, he said.

Police detained the driver and the bus cleaner for questioning, and filed charges including negligence against the bus operator, Jabbar Travels, the transportation minister said. The bus was carrying 50 passengers, seven over its capacity, he said.

The bus, traveling overnight from Bangalore to Hyderabad, was passing another vehicle when it crashed into the roadside barrier in Mehabubnagar in Andhra Pradesh, police official Naveen Kumar Chand said. The diesel tank then caught fire, and flames engulfed the bus.

The victims included a baby, a couple celebrating their 23rd wedding anniversary and several software engineers returning home to Hyderabad from jobs in Bangalore, the transportation minister said.

Angry relatives gathered at both the Bangalore and Hyderabad offices of Jabbar Travels, forcing police to send officers to keep order. Police were also searching for the company's owners in Bangalore, the main city in the neighboring southern state of Karnataka.

India has the highest annual road death toll in the world, according to the World Health Organization. More than 110,000 people are killed every year in road accidents across the country, according to police.

Most crashes are blamed on reckless driving, poorly maintained roads and aging vehicles.

Wednesday's crash happened more than 800 miles from India's capital, New Delhi.