There are those who say that the God of the Old Testament was a God of judgment and vindictiveness, both on Israel, as well as the nations, whereas the God of the New Testament is a God of love and grace. This dichotomy is not true, for God is the same in both Testaments. God was loving and gracious to His people Israel in the Old Testament. Granted, He was judgmental of the other nations. He had good reason to be, as they were idolaters, and trafficked in sexual perversion as worship to their heathen idols. That is why God told Israel to drive them out of the land, or kill them off, and certainly not intermarry with them.
God's judgment on Israel came because they did not follow His ways, and when they repented and turned from their wicked ways, He graciously forgave them, and restored them both to the land as well as in His favor. The problem lay in the inability of Israel to keep the covenant they had agreed to with God at Mt. Sinai. God kept His part of the bargain, and the law itself was holy, just, and good. But, it was Israel who failed to live up to what they had agreed. See: Exod. 19-32 and Matt. 5:17.
One of the reasons God made a covenant with Israel, was to show the inability of mankind to measure up to what God's Holiness requires. The failure of mankind only magnified the work of Christ, in bringing in a new covenant, "In my blood", which was far superior to the old covenant, and satisfied God's holiness. Thereby, mankind does measure up when he accepts what Christ did in making a new covenant for him with God. Hebrews 8-10 speaks to this whole issue, by showing the contrast between the old and the new, and the superiority of the new.
The following passages, all from the Old Testament, show the fact that God was indeed a gracious and merciful God to Israel.