Fires, damaged houses and debris were visible in Mora Kalu village near Rawalpindi after daybreak. Victims' relatives were seen wailing and crying as rescuers loaded charred bodies into ambulances. Rescue officials said 14 civilians, including children, and all five crew aboard the aircraft were killed, including the two pilots.
Farooq Butt, an official at the state-run emergency service, said 14 people were also injured in the crash. He said the death toll could rise as some were in critical condition "Most of the victims received burn injuries," Butt told The Associated Press.
The cause of the crash wasn't immediately known. The military said the army aircraft was on a routine training flight when it crashed, and that an investigation had been opened. As rescue efforts ended, troops and police cordoned off the residential area to search for plane debris and probe the crash site.
Footage on social media showed the plane was flying very low before it quickly went down. Residents said they woke up when they heard an explosion and saw debris from the burning plane near their homes. Army helicopters were later seen hovering over the crash site.
"My sister, her husband and their three children were killed when the plane crashed into their home," said Mohammad Mustafa as he sobbed near his sister's badly damaged house. He said rescuers and troops quickly reached the area after the crash.
Pakistan's President Arif Alvi and Prime Minister Imran Khan expressed their condolences in separate statements. Abdul Rehman, a medical doctor, said at least three homes were badly damaged and that the pilots' bodies had been retrieved. Hours later, a funeral for the pilots was held in Rawalpindi, attended by army chief Gen. Qamar Javed Bajwa, senior army officers and relatives.
It was unclear when funerals for the other victims will be held. Rescue officials said the process of identifying the bodies was taking place at a military hospital. Pakistan's military has been on high alert since February, when India launched an airstrike inside Pakistan to target Pakistan-based militants behind the suicide bombing that killed 40 Indian troops in Indian-administered Kashmir.
Pakistan at the time retaliated and said it shot down two Indian air force planes. One Indian pilot was captured and later released amid signs of easing tensions. In 2010, a Pakistani passenger jet crashed into the hills surrounding the capital, Islamabad, in poor weather, killing all 152 people on board.
Ahmed reported from Islamabad. Associated Press writer Asim Tanveer in Islamabad contributed to this report.