1 Chronicles 11:3-7

11:3 When all the leaders of Israel came to the king at Hebron, David made an agreement with them in Hebron before the Lord. They anointed David king over Israel, just as the Lord had announced through Samuel.

David Conquers Jerusalem

11:4 David and the whole Israelite army advanced to Jerusalem (that is, Jebus). (The Jebusites, the land’s original inhabitants, lived there.) 11:5 The residents of Jebus said to David, “You cannot invade this place!” But David captured the fortress of Zion (that is, the City of David). 11:6 David said, “Whoever attacks the Jebusites first will become commanding general!” So Joab son of Zeruiah attacked first and became commander. 11:7 David lived in the fortress; for this reason it is called the City of David.