Police said the gangster snatched a pistol from one of the policemen injured in the accident and was shot when he opened fire while trying to flee.
Gangster Vikas Dubey was shot dead Friday by police, who claim he was trying to flee after the car carrying him from Ujjain overturned on an isolated stretch of the highway on the outskirts of the city.
The SUV met with the accident at Bhaunti in Kanpur district, toppling on the road which was slippery after the rains, police claimed.
According to a statement from the Special Task Force, the driver had tried to avoid cattle on the road.
The car was part of a small convoy of police vehicles.
Police said the gangster snatched a pistol from one of the policemen injured in the accident and was shot when he opened fire while trying to flee, an account being questioned by opposition parties.
Six policemen, including two from the Special Task Force, were hurt in the accident and the exchange of fire around 6 am, an official said.
Dubey was the sixth man to die in a police encounter after the ambush he allegedly masterminded in Kanpur's Bikru village past midnight on July 2, killing eight policemen who had come to arrest him.
Madhya Pradesh police arrested Vikas Dubey outside the Mahakal temple in Ujjain on Thursday morning. He was handed over to an Uttar Pradesh police team late in the evening.
Kanpur Range Inspector General Mohit Agarwal said Dubey fled from the car with an injured policeman's pistol.
He was chased and surrounded by policemen who asked him to surrender.
When he started firing with an 'intention to kill', police opened fire in self-defence, Kanpur police said.
Blood smudges marked the spot on a dirt road, trailing off the highway, where the alleged gangster was shot.
A press release said he was immediately taken to a hospital, where he died during treatment.
Ganesh Shankar Vidhyarthi Medical College principal Dr R B Kamal said he was brought dead to the hospital.
"Dubey sustained four bullet injuries, three in the chest and one in the hand," he told reporters.
Two policemen also suffered wounds, one in the arm and the other in the hand.
A panel of doctors conducted the post-mortem examination.
Hours before the encounter, an advocate had filed a petition in the Supreme Court seeking a direction to the Uttar Pradesh government and police to ensure that he is not killed.
Uttar Pradesh's Inspector General (Civil Defence) Amitabh Thakur too had apprehended the possibility, a day before it happened.
'Vikas Dubey has surrendered. It is possible he might try to escape from the custody of the UP police tomorrow and get killed. With this, the Vikas Dubey chapter will end,' he had tweeted in Hindi.
Questions were being raised over the police version, challenging the account of the attempted escape of a gangster who had made no attempt to flee when nabbed near Ujjain's Mahakal temple a day earlier.
There was also scepticism over the possibility of someone managing to snatch a policeman's weapon and then extricating himself from an overturned vehicle.
There were allegations that the media trailing the police convoy was stopped for a few minutes before the encounter took place.
Video clips also appeared to show Dubey sitting in a different car when the convoy set out from Ujjain.
The UP police have denied any switching of cars and said the media may have been stopped for checks.
Prakash Singh, a former UP Director General of Police, said he was 'disappointed' about the encounter.
Had Dubey been interrogated, he would have disclosed who had colluded with him, the retired officer said.
Opposition parties targeted the Bharatiya Janata Party government in Uttar Pradesh after the encounter.
Bahujan Samaj Party chief Mayawati demanded a Supreme Court-monitored probe into the encounter as well as the ambush in which eight policemen died last week.
Congress general secretary Priyanka Gandhi Vadra said the criminal is now gone and asked what about those who had 'protected' him.
Her party has demanded a judicial probe in the entire Vikas Dubey episode.
Samajwadi Party chief Akhilesh Yadav said it was not the car that had toppled but the encounter had saved the state government from toppling, had facts come to light.
Eight policemen, including Deputy Superintendent of Police Devendra Mishra, had died in a hail of bullets from the rooftops in Dubey's Bikru village in Chaubeypur area of Kanpur on July 3.
Police suspect that Dubey, who faced about 60 criminal cases over the past several years, was tipped off by someone from Chaubeypur station about the team heading out to arrest him.
Dubey was also alleged to have links with politicians.
Additional Director General of Police (Law and Order) Prashant Kumar said of the 21 people named in the FIR registered after the Bikru ambush, six are now dead and three arrested.
Seven others were also arrested in connection with the same crime. Twelve people, carrying rewards for their arrest, are absconding, he said.
On the day the Bikru ambush took place, two of Dubey's alleged accomplices, Prem Prakash Pandey and Atul Dubey, were killed in an encounter with police in Kanpur district.
On July 8, police killed another aide, Amar Dubey, in Maudaha village in Hamirpur district.
Two more alleged accomplices were killed in Kanpur and Etawah districts on Thursday. One of them, Prabhat, died in circumstances similar to Dubey's killing, according to the police versions.
He was being brought to Kanpur on transit remand after his arrest in Faridabad when he snatched the pistol of a policeman and tried to flee, police had said.
After 6-day run, gangster Vikas Dubey nabbed in MP
How cops nabbed gangster Vikas Dubey
Vikas Dubey's arrest scripted, dubious: Congress
Priyanka demands CBI probe in Vikas Dubey case
2 aides of gangster Vikas Dubey killed in encounters