The driver saw that police were checking cars in the village of Morahalom near the Serbian border and attempted to avoid them by speeding away, police told the MTI news agency on Tuesday.
The car, which was carrying 10 migrants and was headed towards the town of Szeged, then crashed into a house and rolled over.
Police said that the driver, who was also injured, was detained and proceedings against him would be launched for people trafficking and causing a fatal mass accident.
The accident happened near the border of European Union member Hungary with Serbia, which is not part of the bloc. Prime Minister Viktor Orban’s government built a fence in 2015 at the height of the migrant crisis when hundreds of thousands crossed there towards Western Europe.
Orban’s hardline anti-immigration stance helped his conservative Fidesz party win re-election in 2018. Last week 2,419 migrants were stopped at Hungary’s borders, data published by the police shows.