The prisoners will be released in the coming days after Hamas hands over the bodies of four Israeli captives.