The government has recently signed two separate peace deals with Islamist groups in the tribal regions near the border with Afghanistan .