At least four Israelis and 23 Palestinians have been killed in a conflict lasting several days.