Meanwhile , the United States and Afghanistan agreed in principle to transfer most Afghans in U.S. custody to the Afghan government .