An Indonesian military transport plane crashed Tuesday shortly after take-off in a city on Sumatra island, exploding in a ball of flames and damaging nearby buildings.

There was no immediate information on the number of people on board or any casualties on the ground after the Hercules plane went down in the city of Medan.

Dramatic pictures on social media showed large crowds and emergency services gathering around the flaming wreckage, with the fuselage of the aircraft visible among thick plumes of black smoke. Buildings in the vicinity of the crash zone were also clearly damaged.

"A Hercules was... transporting military logistics from Medan," military spokesman Fuad Basya told AFP.

The plane took off 12:08 pm (0508 GMT) from an air force base and crashed in the city about two minutes later about five kilometres (three miles) from the base, he said.

Asked about potential casualties, Basya said: "We don't know for sure but inside there will be the plane crew, pilot, but I don’t know how many."