RAWALPINDI, Pakistan (Reuters) - A Pakistani military aircraft on a training flight crashed in a built-up area in the garrison city of Rawalpindi early on Tuesday killing all five crew members and 12 civilians and setting off a blaze that left a pile of smoking rubble.

A statement from the Pakistani military said the aircraft was on a routine training flight when it crashed but there was no immediate word on the cause of the accident or the type of aircraft involved.

Military and civilian rescue workers took at least 12 injured civilians to hospitals in the city and extinguished the fire, leaving the smoking ruins of a house which appeared to have borne the brunt of the crash.

“The plane hit the side of the building and the structure it has crashed into has completely collapsed,’ an army officer at the scene said.

The site, in a village on the edge of an affluent housing development called Bahia Town, was surrounded by military and rescue service vehicles and security officials pushed back a crowd of bystanders.

Rawalpindi is close to the capital Islamabad and is where the headquarters of the Pakistan army is based.

Earlier, the website of newspaper The News International carried footage showing a building engulfed in flames in the immediate aftermath of the crash.