Fires, damaged homes and debris were visible in Mora Kalu village on the outskirts of Rawalpindi after daybreak.
Troops and police cordoned off the residential area to search for plane debris and investigative evidence after the rescue efforts had ended.
Five soldiers, including two army pilots, and at least 13 civilians were killed, the military said in a statement.
Farooq Butt, an official at the state-run emergency service, said an additional 15 people were injured.
Rescue officials said the death toll could continue to rise since some of those injured were critical.
“We have shifted all the bodies and injured persons to hospitals,” he said.
“Most of the victims received burn injuries and children are among the dead.”
Residents say they woke up when they heard an explosion and saw debris of a burning plane near their homes. Army helicopters were seen hovering over the crash site later.
“My sister, her husband and their three children were killed when the plane crashed into their home,” said Mohammad Mustafa.
He said rescuers and troops quickly reached the area after the crash.
Abdul Rehman, a medical doctor, said at least three homes were badly damaged and the pilots’ bodies had been retrieved.
The military said the army aircraft was on a routine training flight when it crashed, but had no information on the possible cause.
Pakistan’s President Arif Alvi and Prime Minister Imran Khan in separate statements expressed their condolences.