Solomon made an alliance with the king of Egypt by marrying his daughter. He brought her to live in David's City until he had finished building his palace, the Temple, and the wall around Jerusalem.
Solomon loved the LORD and followed the instructions of his father David, but he also slaughtered animals and offered them as sacrifices on various altars.
On one occasion he went to Gibeon to offer sacrifices because that was where the most famous altar was. He had offered hundreds of burnt offerings there in the past.
Solomon answered, "You always showed great love for my father David, your servant, and he was good, loyal, and honest in his relation with you. And you have continued to show him your great and constant love by giving him a son who today rules in his place.
So give me the wisdom I need to rule your people with justice and to know the difference between good and evil. Otherwise, how would I ever be able to rule this great people of yours?"
and so he said to him, "Because you have asked for the wisdom to rule justly, instead of long life for yourself or riches or the death of your enemies,
Solomon woke up and realized that God had spoken to him in the dream. Then he went to Jerusalem and stood in front of the LORD's Covenant Box and offered burnt offerings and fellowship offerings to the LORD. After that he gave a feast for all his officials.
The next morning, when I woke up and was going to nurse my baby, I saw that it was dead. I looked at it more closely and saw that it was not my child."
But the other woman said, "No! The living child is mine, and the dead one is yours!" The first woman answered back, "No! The dead child is yours, and the living one is mine!" And so they argued before the king.
The real mother, her heart full of love for her son, said to the king, "Please, Your Majesty, don't kill the child! Give it to her!" But the other woman said, "Don't give it to either of us; go on and cut it in two."
When the people of Israel heard of Solomon's decision, they were all filled with deep respect for him, because they knew then that God had given him the wisdom to settle disputes fairly.