"We can confirm 31 dead and over 10 others seriously injured in the inferno," Kampala Metropolitan Police commander Andrew Kaweesa told AFP after inspecting the scene of the accident that took place on Saturday night.
"Most of the victims were scooping fuel from the tanker after it was hit by a car and fuel spilled out," Kaweesa said.
"People rushed there to take the fuel and in the process fire broke out engulfing the whole area and trapping them," he added.
Numerous motorbikes -- some with the petrol tank still on fire -- littered the scene.
Police said many of the victims appeared to have headed to the scene on motorbike taxis, a common form of transport in Kampala.
The accident is the worst of its kind in Uganda since December 2001 when some 90 people perished in similar circumstances in the east of the country, police said.