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.
"I saw the plane from the direction of the airport and it was tilting already, then I saw smoke billowing," local resident Januar, 26, told AFP, only giving his first name.
"A Hercules was... Transporting military logistics from Medan," military spokesman Fuad Basya told AFP.
More From This Section
The plane took off 12:08 pm (local time) 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."
"It crashed near a residential area and caught fire," search and rescue agency official Tatang Zainuddin told AFP.