1 Kings 11:9

So the LORD became angry with Solomon, because his heart had turned from the LORD God of Israel, who had appeared to him twice,

Surrounding context

11:8 And he did likewise for all his foreign wives, who burned incense and sacrificed to their gods.

11:9 So the LORD became angry with Solomon, because his heart had turned from the LORD God of Israel, who had appeared to him twice,

11:10 and had commanded him concerning this thing, that he should not go after other gods; but he did not keep what the LORD had commanded.

Translation and sources