The deal, which will also see hostages held in Gaza released, is expected to take effect on Sunday.