Mediators say Israel and Hamas have agreed to a pause in fighting in Gaza and to begin releasing the hostages held there.