1 Chronicles 11:6

And David said, Whosoever smiteth the Jebusites first shall be chief and captain. So Joab the son of Zeruiah went first up, and was chief.

At the time of the offer that whoever struck the Jebusites first would be chief and captain, the Jebusites held a fortified stronghold at Jebus. Joab the son of Zeruiah went up first and led the initial assault, and for that valor he was made commander-in-chief of Israel's armies. The Hebrews captured the stronghold, and it became Israel's capital under the new name Jerusalem.