The UN-backed agreement will see the ICRC facilitate the exchange of hundreds of detainees from both sides.