According to security sources, the two men were planning to carry out terrorist activities in Mardan city.
The sources said the alleged terrorists had confessed to forming two groups to attack the Punjab Regimental Centre and the Saddar police station in Mardan.
The accused were arrested on the basis of a tip-off from intelligence operatives.
In a separate development, three rockets were fired at Bannu Cantonment in northwest Pakistan by terrorists. There were no casualties, security officials said.