David was thirty years old when he became king, and he reigned forty years. At Hebron he reigned over Judah seven years and six months, and in Jerusalem he reigned thirty-three years over all Israel and Judah.
– 2 Samuel 5:4-5
David became king when he was thirty and ruled for forty years. For the first seven years, he was king only over Judah, ruling from Hebron. Soon after he became king over all Israel, he captured the city of Jebus, renamed it Jerusalem, and ruled from there. That was a great matter, for even in eternity God rules from a city named Jerusalem. Eventually David moved the ark of the Lord to Jerusalem and placed it in a tabernacle. What was called the city of David, the city of the king, now became God’s city.
Adapted from David: After God’s Heart, page 97.