The Pakistani government is under pressure from neighboring Afghanistan and the United States to take on militants based along the Afghan border .