When Solomon had finished building the house of the Lord and the king's house and all that Solomon desired to build,
the Lord appeared to Solomon a second time, as he had appeared to him at Gibeon.
The Lord said to him, "I have heard your prayer and your plea, which you made before me; I have consecrated this house that you have built, and put my name there forever; my eyes and my heart will be there for all time.
As for you, if you will walk before me, as David your father walked, with integrity of heart and uprightness, doing according to all that I have commanded you, and keeping my statutes and my ordinances,
then I will establish your royal throne over Israel forever, as I promised your father David, saying, "There shall not fail you a successor on the throne of Israel.'
"If you turn aside from following me, you or your children, and do not keep my commandments and my statutes that I have set before you, but go and serve other gods and worship them,
then I will cut Israel off from the land that I have given them; and the house that I have consecrated for my name I will cast out of my sight; and Israel will become a proverb and a taunt among all peoples.
This house will become a heap of ruins; everyone passing by it will be astonished, and will hiss; and they will say, "Why has the Lord done such a thing to this land and to this house?'
References for 1 Kings 9:8
Then they will say, "Because they have forsaken the Lord their God, who brought their ancestors out of the land of Egypt, and embraced other gods, worshiping them and serving them; therefore the Lord has brought this disaster upon them.' "