Hamas agreed to release 13 Israelis and seven foreigners late Saturday in exchange for 39 Palestinians imprisoned by Israel, Qatari and Egyptian mediators said, after the militant group delayed the second round of swaps for several hours and claimed that Israel had violated the terms of a truce deal.