With U.S. military officers sometimes present , and as North Korean invaders pushed down the peninsula , the southern army and police emptied South Korean prisons , lined up detainees and shot them in the head , dumping the bodies into hastily dug trenches .