Update as of 6:04 a.m. EDT: Search and rescue operations for the victims of an Indonesian military plane crash in Medan city have ended, North Sumatra Regional Military Commander Maj. Gen. Edi Rahmayadi said Wednesday, according to the Associated Press, adding that the probe into the crash was ongoing.

Rahmayadi reportedly said that about 500 military personnel, backed by 200 police officials, were involved in the search operation. 

The Hercules C-130, which crashed Tuesday, was authorized to carry military personnel and their families, Indonesia's air force chief Air Marshal Agus Supriatna, reportedly said, adding that authorities were investigating allegations of unauthorized passengers on board the plane.

Original story:

The death toll from an Indonesian military plane crash in the country's third-largest city of Medan climbed to 141 on Wednesday as rescuers pulled bodies from the rubble. The Hercules C-130 transport aircraft, which was carrying 122 people, crashed on Tuesday shortly after takeoff from the Soewondo air force base in Medan.

So far, 45 of all the bodies recovered from the crash site have been identified, Agustinus Tarigan, a police official at a local hospital said, according to Agence France-Presse (AFP). It is unclear how many people died on the ground, but the latest death toll indicates that at least 19 people were killed on the ground after the plane hit several buildings and vehicles. 

Most of those identified "were from the armed forces because they were wearing uniform," Tarigan said, according to AFP, adding that 30 air force personnel, six army personnel and some civilians were among them.

The aircraft was on its way to Tanjung Pinang, capital of Indonesia's Riau Islands province, when the pilot informed the air control tower that the plane needed to turn back because of engine trouble, Air Marshall Agus Supriatna reportedly said. "The plane crashed while it was turning right to return to the airport," he said. Witnesses reportedly said that the plane was shooting flames and smoke before it crashed. 

Supriatna added that the plane, manufactured in 1964, was in a good condition.

Following the incident, Indonesia's President Joko Widodo promised a review of the country's ageing air force fleet. "There must be an evaluation of the age of planes and defence systems," he reportedly wrote on his Twitter account late on Tuesday. Widodo also expressed grief over the lives lost in the crash.