At least 130 bodies have been found after an Indonesian air force C-130 crashed in a residential neighbourhood in the city of Medan on the northern island of Sumatra, according to military officials.

The plane came down on Tuesday hitting empty residential buildings after bursting into flames shortly after takeoff.

As rescuers continued to pull bodies and body parts out of the wreckage, a military spokesman told Al Jazeera that 110 passengers and 12 crew were believed to have been on board.

Eight others were believed to have been killed on the ground.

Late on Tuesday, Indonesian President Joko Widodo expressed sorrow at the accident, tweeting in Bahasa, "May the families be given patience and strength... May we remain protected from disaster."

The Hercules transport plane was on its way from an air force base in Medan to Tanjung Pinang in Sumatra.

INTERACTIVE: A timeline of major air disasters over the past 15 years

Al Jazeera's Stefanie Dekker said the dead included civilian relatives of military personnel.

"This was a C-130 military aircraft on a routine trip, carrying soldiers and their families," she said.

Our correspondent said that two minutes into the flight, the pilot radioed in, saying there was a "technical issue" with the plane.

"He tried to turn back and then the plane went down over Medan. The plane went down in a populated area, hitting two empty buildings. That number could have been much higher."

She said that questions were now raised as to the safety of the plane, which was built in 1964.

It was the sixth fatal military crash in the last 10 years.

One witness Januar, 26, said the aircraft appeared to be in trouble just before the accident.

"I saw the plane from the direction of the airport and it was tilting already, then I saw smoke billowing," he said.

The Indonesian military has now opened an official investigation to try and figure out what went wrong. The government has grounded all C-130 aircraft while the investigation is ongoing.

RELATED: Malaysia marks first anniversary of MH370 disappearance

Speaking shortly after the crash, Mardiaz Dwihananto, police chief of Medan city, said several bodies had been recovered from the wreckage.

"The bodies were in [the] debris of the plane and buildings... We are taking the bodies one by one by ambulance to Adam Malik hospital. We haven't managed to evacuate all of the bodies," Dwihananto said.

Military spokesman, Fuad Basya, said the plane took off at around midday local time from an air force base carrying military equipment and crashed in the city about two minutes later, about 5km from the base.

It is the second time in 10 years that a plane has crashed into a Medan neighbourhood.

In September 2005, a Mandala Airlines Boeing 737 crashed shortly after takeoff from Medan's Polonia airport, into a crowded residential community, killing 143 people including 30 on the ground.

FROM AL JAZEERA'S VAULT: What happens when trust in air travel is shaken?

Medan, with about 3.4 million people, is the third most populous city in Indonesia after the capital Jakarta and Surabaya.