MANILA, Philippines — A Philippine air force C-130 aircraft carrying combat troops assigned to fight Muslim militants crashed and exploded while landing in the south Sunday, killing at least 42 army soldiers on board and three civilians on the ground in one of the worst disasters in the air force’s history.

At least 49 other soldiers were rescued with injuries and survived the fiery noontime crash into a coconut grove outside the Jolo airport in Sulu province, including some who managed to jump off the aircraft before it exploded and was gutted by fire, military officials said. Three of seven villagers who were hit on the ground died.

The aircraft had 96 people on board, including three pilots and five crew while the rest were army personnel, the military said, adding only five soldiers remained unaccounted for late Sunday. The pilots survived but were seriously injured, officials said.

The Lockheed C-130 Hercules was one of two ex-U.S. Air Force aircraft handed over to the Philippines as part of military assistance this year.

The aircraft originally took off from Manila with only a few passengers, including a two-star army general, Romeo Brawner Jr., who disembarked with his wife and three children in Cagayan de Oro city, where he’s set to become the new military regional commander on Monday. The army troops then boarded the C-130 in Cagayan de Oro for the flight to Sulu.

Brawner said he was stunned to learn that the plane he’d just flown on had crashed.

“We’re very thankful that we were spared, but extremely sad that so many lost their lives,” Brawner said.

Officials said the injured personnel were brought to a hospital in Sulu or flown to nearby Zamboanga city, and troops were continuing to search for the missing.

Initial images released by the military showed the tail section of the cargo plane relatively intact. The other parts of the plane were burned or scattered in pieces in a clearing surrounded by coconut trees. Soldiers and other rescuers with stretchers were seen dashing to and from the smoke-shrouded crash site, where dark gray smoke billowed shortly after impact.

The plane was transporting troops, many of them new soldiers who had just undergone basic training, from the southern Cagayan de Oro city for deployment in Sulu, officials said.

“They were supposed to join us in our fight against terrorism,” Sulu military commander Maj. Gen. William Gonzales said. Government forces have been battling Abu Sayyaf militants in the predominantly Muslim province of Sulu for decades.

It was not immediately clear what caused the crash. Regional military commander Lt. Gen. Corleto Vinluan said it was unlikely that the aircraft took hostile fire, and cited witnesses as saying that it appeared to have overshot the runway then crashed on the periphery of the airport.