The five were hanged in Kohat district jail in Khyber-Pakhtukhwa province, according to a statement by army.
Army said the convicted terrorists were involved in attacks on army and other law enforcement personnel and admitted their offences before the magistrate and the trial court.
The execution came in the midst of a debate about reviving the controversial military courts for another two years for speedy trial of terrorists, after a fresh wave of suicide attacks killed over 125 people recently.
The military courts were set up in January 2015 for a two year term after a constitutional amendment following a terror attack on an army-run school in Peshawar in December 2014 that killed over 150 people, mostly students.