Riaz Ahmed, Hafeez ur Rehman, Muhammad Saleem and Kifayat Ullah were members of a proscribed organisation, army's media wing Inter Services Public Relations said in a statement.
The convicts were involved in offences of terrorism, including the killing of civilians, attacking law enforcement agencies and armed forces.
They were involved in killing of 16 persons and injuring eight others, the statement said, adding that arms were also recovered from their possession.
The military courts were legalised in Pakistan after the deadly terror attack on an Army school in Peshawar in which nearly 150 people, mostly children, were killed.