Shlomo formed an alliance with Pharaoh king of Egypt by marrying Pharaoh's daughter. He brought her into the City of David, [where she lived] until he had finished building his own palace, the house of ADONAI and the wall around Yerushalayim.
The people, however, were still sacrificing on the high places, because no house had yet been built for the name of ADONAI.
Shlomo loved ADONAI, living according to the regulations set forth by David his father; nevertheless, he sacrificed and made offerings on the high places.
One time the king went to Giv'on to sacrifice there, because that was the main high place. Shlomo offered a thousand burnt offerings on the altar there.
At Giv'on ADONAI appeared to Shlomo in a dream at night; God said, "Tell me what I should give you."
Shlomo said, "You showed your servant David my father much grace, as he lived before you honestly and righteously, having an upright heart with you. You preserved this great grace for him by giving him a son to sit on his throne, as is the case today.
So now, ADONAI my God, you have made your servant king in the place of David my father; but I am a mere child - I don't know how to lead!
Moreover your servant is among your people, whom you chose, a great people so numerous that they cannot be counted.
Therefore, give your servant an understanding heart able to administer justice to your people, so that I can discern between good and bad - for who is equal to judging this great people of yours?"
What Shlomo had said in making this request pleased Adonai.
God said to him, "Because you have made this request instead of asking long life or riches for yourself, or your enemies' death, but rather asked for yourself understanding to discern justice;
I am doing what you requested. I am giving you a wise and understanding heart, so that there has never been anyone like you, nor will there ever again be anyone like you.
I am also giving you what you didn't ask for, riches and honor greater than that of any other king throughout your life.
More than that, if you will live according to my ways, obeying my laws and mitzvot like your father David, I will give you a long life."
Shlomo awoke and found it had been a dream. But he went to Yerushalayim, stood before the ark for the covenant of ADONAI and offered up burnt offerings and peace offerings. He also made a feast for all his servants.
After this, there came to the king two women who were prostitutes. After presenting themselves to him,
one of the women said, "My lord, I and this woman live in the same house; and when she was in the house, I gave birth to a baby.
Three days after I gave birth, this woman also gave birth. We were there together; there was no one else with us in the house except the two of us.
During the night this woman's child died, because she rolled over on top of it.
So she got up in the middle of the night and took my son from next to me, while your servant was sleeping, and put it in her arms; and she laid her dead child in my arms.
When I awoke in the morning to feed my child from my breast, there it was, dead. But when I took a closer look later in the morning, why, it wasn't my son at all - not the one I gave birth to!"
The other woman broke in, "No! The living one is my son, and the dead one is your son!" The first one said, "No! The dead one is your son and the living one is my son!" This is how they spoke in the presence of the king.
Then the king said, "This woman says, 'The living one is my son; your son is the dead one'; while the other says, 'No, the dead one is your son, and the living one is my son.'
Bring me a sword," said the king. They brought a sword to the king.
The king said, "Cut the living child in two; give half to the one and half to the other."
At this, the woman to whom the living child belonged addressed the king, because she felt so strongly toward her son: "Oh, my lord, give her the living child; you mustn't kill it!" But the other one said, "It will be neither yours nor mine. Divide it up!"
Then the king answered, "Give the living child to the first woman, don't kill it, because she is its mother."
All Isra'el heard of the decision the king had made and held the king in awe, for they saw that God's wisdom was in him, enabling him to render justice properly.