Afghanistan and Iran have agreed to a prisoner exchange, the Foreign Ministry in Kabul said on Thursday, a sign of warming relations between the two neighbors ahead of the planned withdrawal of foreign combat forces from Afghanistan in 2014.