But after all that wisdom and all those riches, Solomon drops the ball and breaks God's commandments. Tsk, tsk.
See God commanded Solomon not to marry foreign women, because he knew they'd turn him to idolatry. But Solomon can't resist. He just loves those exotic Moabites, Ammonites, Edomites, Sidonians, and Hittites.
In fact, Solomon loves them so much that he accumulates at least 700 princess-wives and 300 concubines.
As he gets older, Solomon's wives turn his heart away from God and toward their gods, like Astarte (the goddess of the Sidonians) and Milcom (the abomination of the Ammonites).
Solomon builds a temple for Chemosh, a Moabite god, and Molech, an Ammonite god, and for all of the other gods his wives worship. Bad move, Solomon.
Needless to say, God's pretty mad. He tells Solomon that he is going to lose his kingdom because of this betrayal.
For his father David's sake though, God will wait until Solomon's dead to take the kingdom from him. He'll let his son keep one tribe. It's a pretty decent move on God's part.
The stage needs to be set for the fall of Solomon's government, so God raises up a few enemies.
First there's Hadad the Edomite.
Years earlier, when Hadad was a young boy, David conquered Edom. Joab, his commander, killed every male. But Hadad escaped with some of his father's servants, and hid out in Egypt. There, the Pharaoh gave him a place to live. These two became such good pals that Pharaoh gave Hadad his sister-in-law as a wife. Hadad lived with Pharaoh until he heard that David and Joab were dead. Pharaoh didn't want him to leave, but Hadad really wanted to go home, so he did and became Solomon's rival.
Next God raises up Rezon, a former leader of a band of marauders who became king of Damascus.
And then God raises up Solomon's main adversary: Jeroboam.
Jeroboam was the son of one of Solomon's servants. A talented and energetic worker, Solomon put Jeroboam in charge of repairing the walls of Jerusalem.
One day Jeroboam was outside the walls and wearing some new clothes when he bumped into a prophet named Ahijah out in a field. Ahijah grabbed Jeroboam's garment and ripped it into twelve pieces, saying (more or less): "Take ten pieces to represent the ten tribes that God has promised to take from Solomon (or, more specifically, Solomon's son) and give to you, because Solomon forsook God and worshipped Astarte, Chemosh, and Milcom. Solomon's son will keep one tribe so David's line will continue in Jerusalem."
Solomon hears about this whole exchange, so he wants to kill Jeroboam, but Jeroboam is smart and has already fled to Egypt, where he remains until Solomon dies.
After 40 years of reign, Solomon dies and is buried in the City of David, and his son Rehoboam reigns in his place.