The news of Abner's murder made a deep impression on Ishbosheth. He had no knowledge of his fallen general's treacherous league with David, and he therefore deeply mourned the death of a hero whom he supposed to be faithful, and whose loss seemed to be irreparable, for he considered Abner as the chief support of his throne.

After Ishbosheth's death the kingdom of the ten tribes naturally fell to David. Among them, too, he had adherents of long standing, who remembered his warlike deeds against the Philistines in Saul's time, and who honoured him as the chosen one of God through his prophet Samuel. Others had been won over to his side by Abner. Even those who took offence at David's league with the enemies of Israel, could not hide from themselves the consideration that no choice was left them but to do him homage. The Benjamites also acknowledged him, but with a secret grudge, which they could hardly conceal. David's dearest wish was now realised; from having been the ruler of a little, insignificant tribe he had become, after many obstacles and troubles, the king of all Israel. The breach between the houses of Judah and Israel was healed apparently, and everything seemed favourable to him. The priesthood and the prophets did not take a hostile attitude towards him, as they had done towards Saul, but joined with heart and soul in his cause. A descendant of the house of Eli, named Abiathar, who had shared David's troubles, belonged to his court; and the prophets welcomed in him the man who had been anointed by Samuel, and had belonged to that great man's circle of disciples. The prophet Gad was also a member of the court; and another prophet of the time, named Nathan, was to a certain extent the keeper of David's conscience. Thus encouraged in all his undertakings by his spiritual advisers, everything tended to level the way for him, as far as the internal government was concerned. But his foreign relations occasioned him great difficulties, which had to be overcome before he could rule as an independent king.

In the first place, David was forced to break with the Philistines, if he wished to be independent, and to win back the love of his people. He had to prepare himself for fierce warfare with his former auxiliaries. But he did not immediately commence hostilities with them; they were too powerful for him. He wished first to free himself from other bonds. In the midst of the Benjamite territory was an enclosure, which had remained in the possession of the Jebusites, because the Israelites, on their entry into the land, had not conquered it. The high hill of Zion was rendered inaccessible on three sides by narrow valleys and artificial fortifications. The most impregnable point was the south side, where the rocky wall of the hill rose almost in a vertical line from an abyss below. From this mountain fortress, the Jebusites ruled the entire surrounding territory, and felt themselves secure from all intruders. They appear to have lived in a state of peace with the surrounding Benjamites and Judæans, as even Saul did not disturb them in the possession of their territory. David, however, considered it conducive to his interest to obtain possession of this citadel of Zion before commencing hostilities with the Philistines. He therefore resolved to storm the citadel, and subdue its defenders. As soon as the Jebusites found all opposition useless they sued for peace, which was granted them by David. They were allowed to remain in their city, but not in the fortress; he permitted them to settle in the east of the town, on Mount Moriah. This victory, which had appeared so difficult, and had, in fact, been easily obtained, had been preceded by the boast of the Jebusites about the blind and the lame, which gave rise to a proverb.

After its conquest, David removed his capital from Hebron to Mount Zion, and it was henceforth known as the town of David. The city itself lost its old name of Jebus, and received the new name Jerusalem (Jerushalayim), the meaning of which is not known. Hither David removed with his warriors and their families, and his courtiers. The spot where the bravest soldiers had their dwellings was called after them the house of the brave (Beth-ha-Gibborim). Such was the beginning of the place which since then, and for centuries, was to be known as the "Holy City." The choice of this spot as a capital was a happy stroke, as circumstances soon proved. It is true, Shechem would have made a better metropolis, on account of its position in the midst of the tribes, and the fruitful territory around it. But David found it impossible to move his dwelling to the town of the Ephraimites. The inhabitants were not especially well disposed towards him, and rather unwilling that the half-savage king, who sprang from Judah, should prescribe laws to them. Besides, he needed the support of his own tribe, and this he could have in Jerusalem, which was situated on the boundaries of Benjamin and Judah, and which would serve as a protection in the event of unruliness on the part of the other tribes. The territory on which the new capital was erected was not sterile, though it could bear no comparison with the part of the country in which Shechem lay. In the valleys flow everlasting springs, the springs of Siloah and En-Rogel in the south, the Gihon in the west; so that in the dry season the town and fields can always be supplied with water. On three sides Jerusalem is surrounded by a range of hills which protect and embellish it. On the east is a high watershed (2724 feet), Mount Olivet, so named from the olive trees which cover it. In the south the hills are not so lofty, and the valley dividing them from the city is narrower. The valley is that of Henna (Ge-henna), which was thus named after an individual or a family, and which was destined to acquire a sad renown, and to supply another appellation for hell (Gehenna). On the west the summits are also low, and can hardly be called hills. On the north, the hills gently slope down to the plain. By these hills and valleys, which form natural walls and ditches, Jerusalem is sheltered on three sides. Within Jerusalem, on the high plateau and between the three valleys on the east, south, and west, there are three ranges of hills rising above the plain. On the west is Zion, the loftiest summit. On the north is a hill of no great height; and opposite the third is Mount Moriah, which has an offshoot towards the south, called "Ophel." Moriah, though much less lofty than Zion, was destined to eclipse it and the greatest heights on earth in importance.

The Philistines could not ignore the fact that the choice of David as king of the entire Israelite nation had not only greatly loosened the bond which united him to them, but that it must in the future force him to take up a hostile attitude towards themselves. They did not, however, wish to break with him. But when the conquest of Jebus (Jerusalem) took place, they considered the fact of his removing his dwelling thither as a premonitory sign. They hastened to join with him in battle, before he had time to arm the available troops of the various tribes. A Philistine band pressed forward across the plain into the mountains, and approached Jerusalem. Whether David was surprised by their attack, or whether he wished to avoid an action near his capital, is unknown, but he left it with his troops, and moved southwards to Adullam. Encouraged by this retreat, the Philistines pressed on to Bethlehem, David's birthplace, where they encamped, and whence they sent out predatory expeditions to ravage the land of Judah. David delayed attacking the Philistines; his army was probably too weak, and he expected reinforcements from the tribes. In order to stimulate his warriors to trials of strength during the pause before the decisive contest, David expressed a wish to drink water from a well in Bethlehem, which was in the possession of the Philistines. Three of the chief warriors, Jesheboam, Eleazar, and Shammah, immediately set out against the Philistines, daringly drew water from the well, and brought it to David at Adullam. David, however, would not drink the water for which his warriors had risked their lives. He had only put them to the test. At length the Israelite troops went forth to meet the Philistines, and utterly routed them at Mount Baal-Perazim. This victory was so decisive that it was compared with Joshua's at Gibeon. In their hurried flight, the Philistines left behind them their idols, which were burnt by the Israelites. The enemy did not, however, relinquish their intention of subduing David and his people. They made repeated attacks, once in the valley of Rephaim, another time near Ephes-dammim in Terebinthea; David's troops and warriors performed miracles of bravery, they defeated their enemies, and pursued them as far as Gaza. David did not content himself with mere defence, but he determined on attacking the Philistines. If he wished to protect his people, it was necessary either constantly to harass, or to subdue the small but powerful nation which depended on incursions and warfare for its maintenance. He therefore proceeded with his soldiers as far as Gath, the former capital of the Philistines, which was situated nearest to the land of Judæa. The Philistines made a very obstinate resistance, and violent conflicts arose, in which David's heroes had ample opportunity for distinguishing themselves. It appears that the Philistines suggested, according to their custom, that there should be combats with the remnant of their Rephaitic giants. Times had changed, however, and whilst in David's youth the Israelitish troops had not had among them a single soldier who would accept Goliath's challenge, there were now more than thirty who burned with eagerness to take part in the duels. On this occasion the warriors entreated the king not to expose himself in battle, and, in fact, not to go to war himself, in order that "the light of Israel" might not be extinguished.

At length the Israelites succeeded in utterly routing the Philistines, so that they were obliged to surrender their capital Gath, and its villages and the surrounding territory. The town in which the son of Jesse had first appeared, entreating help in the guise of an imbecile, thus fell before him. One of the thirty warriors, Sibbechai of Hushah, killed the giant Sippai of Gath; another man from Bethlehem named Elhanan, killed the brother of Goliath, named Lahmi, who had sallied forth to the contest like Goliath, laden with armour. David's nephew Jonathan killed a giant who had an additional finger on each hand, and an additional toe on each foot. David himself was once, when exhausted from the long struggle, in imminent danger of being overcome by the giant Ishbi of Gath; Abishai, however, Joab's brother, hurried to his aid, defeated the giant, and killed three hundred Philistines with his spear. The overthrow of the Philistines was an event of the greatest importance; it ensured lasting peace and freedom of action to the people, for none of the other enemies of Israel harassed it so persistently. David did not push his victory further; he left the important cities of Gaza, Askelon, Ashdod and Ekron undisturbed, and even the town of Gath he appears later on to have restored to its king. No doubt he had reasons for not using extreme measures with the Philistines. It appeared to him better to rule them as a tributary power than to drive them to a war of desperation.

By his victory over the Philistines, David attained great importance and respect in the eyes of the neighbouring peoples. Hiram, the king who had transferred the Phœnician power from Zidon to Tyre, despatched ambassadors to David, offering to make an alliance with him. He also offered to send supplies of cedar wood and building materials for adorning the new capital of Jerusalem in a fitting manner. He rejoiced at the subjection of the Philistines, probably because they would no longer be able to cast covetous glances at the Phœnician coast-lands. It was a matter of great interest to the king of Tyre to secure an alliance with David, in order that the Phœnician caravans might have free passage, and find protection for their goods when they passed backwards and forwards between Phœnicia and Egypt. David willingly accepted his advances, and thus a sort of friendship arose between him and Hiram. He accepted Hiram's offer in order to fortify the capital which had been founded by him, and to obtain materials for adorning it with architectural works, so that Jerusalem might vie in outward appearance with the other capitals of those times. In the first place Jerusalem was fortified, especially on the north, where it was most liable to be attacked. The hill of Zion, or City of David, was, in fact, not sufficiently extensive to contain all the inhabitants who had already settled there, and it had become necessary to take measures to provide for the increasing population. For this reason, the hill which lay to the north of the town was included in its boundaries. Between Zion and this hillock lay a narrow valley. The northern elevation of the town was called Millo (border); it was considered the newer quarter of the town, in comparison with the more ancient city of David. Mount Moriah and its offshoot Ophel remained outside the circuit of the city, and in those days was not considered as belonging to Jerusalem, but was inhabited by the surviving remnant of the Jebusites. David also built a palace of cedar, the wood for which was procured from Lebanon. To Joab and the other important personages of David's court were assigned roomy and well-built houses, which were not constructed of cedar wood, but of cypress.

David further sought to make Jerusalem the centre of religious life, in order that the eyes of the whole nation might be turned towards it. He therefore took measures to remove the ark of the sanctuary from the house of Abinadab at Kirjath-Jearim, where it had remained since its recovery from the hands of the Philistines. A splendid tent was built for its reception in the city of David. David had vowed not to remain in his house, nor to rest on his bed, nor to close his eyes in sleep until he had found a resting-place for the ark of the covenant. Accompanied by a great concourse, the king repaired to Kirjath-Jearim (which lay at about an hour's journey to the north-west of Jerusalem), and many Levites followed in the king's train. The ark of the sanctuary was placed on a new carriage drawn by bullocks, which were led by two sons of Abinadab. Choirs of Levites sang hymns, and accompanied themselves on stringed instruments, and David also assisted them with all his might. An accident, however, occurred on the road. Uzzah, who walked next to the chariot, suddenly fell down dead. David was so shocked at this catastrophe that he hesitated to carry the ark of the covenant into Jerusalem. He feared that it might bring down misfortune on the people, as it had done in the case of the Philistines. It was therefore placed in a house for three months, and, seeing that no evil came of it, David determined on making a second attempt at bringing it to Mount Zion. On this occasion, however, it was not placed on a chariot, but was carried by Levites. Followed by a mass of people, and amidst shouts of joy, blasts of trumpets, and dancing, the ark was conveyed to the tent appointed for it. The king himself, oblivious of his dignity, sang and danced in exultation before the ark. His conduct called forth a rebuke from his wife Michal, who scoffingly charged him with behaving like a public clown.

As it had done in the case of Shiloh, the arrival of the Ark raised Jerusalem to the dignity of a holy city. In such a place of public worship, it was necessary to maintain a priest, or rather a priesthood. Abiathar, David's faithful follower in all his wanderings, was, as a matter of course, raised to the office of High Priest to the sanctuary in Zion. There was, however, another high priest in Gibeon, whom Saul had placed there after the destruction of Eli's family in Nob. David could not entirely displace him, for such a course would have led to dissensions. He therefore confirmed his predecessor's appointment, and thus retained two high priests in office at the same time—Abiathar in Jerusalem, and Zadok in Gibeon. A former pupil of the Levitical choirs, himself a poet and a musician, David naturally followed Samuel's example and introduced choral singing into the solemn religious services. He also composed hymns of praise at times, when a victory over the enemy, or some other success filled his heart with thankfulness, and animated him with poetical fervour. It may be said that his songs have become the prototypes of this lofty and inspiring style of verse. Besides the royal psalmist there were other poets and musicians, such as Asaph, Heman, a grandson of Samuel, and Jeduthun. Their descendants were the Asaphites and Korachites (Bene Korach), who are named with David as the most famous composers of psalms. David arranged that Asaph and his choir should lead the choral service in the sanctuary at Jerusalem, whilst his fellow-musicians, Heman and Jeduthun, performed the same functions at the altar in Gibeon. Samuel's creation of a spiritual divine service was thus firmly established by David; and though he was an upholder of sacrificial rites, he valued the elevating and refining influence of psalmody too highly not to make it an integral element of the public cult. At a time when poetry as an art had hardly awakened amongst the other nations, it already occupied a prominent place in the divine service of Israel.

As David was the actual founder of a sanctifying divine worship, he was also the creator of a system of government which was based on justice. He presided at the tribunal, listened untiringly to the disputes of individuals or of tribes, and administered justice with strict impartiality. His throne was not only the high seat of government and power, it was also that of order and justice. Succeeding generations pronounced David the ideal king. His throne was looked upon as the prop of justice, and his sceptre as the standard of civic peace. Jerusalem was by him made an ideal city, where a pure worship of God had been established, and justice, in its most exalted form, had found its earthly resting-place. A later psalmist says—