1 Kings 11:4

11:4 When Solomon became old, his wives shifted his allegiance to other gods; he was not wholeheartedly devoted to the Lord his God, as his father David had been.

1 Kings 11:9

11:9 The Lord was angry with Solomon because he had shifted his allegiance away from the Lord, the God of Israel, who had appeared to him on two occasions