The agreement comes as Afghanistan faces a worsening humanitarian crisis.