He was directly appointed by Jehovah to do so. He is the only one mentioned in the Hebrew Scriptures who served as both a king and a priest.
ثُمَّ حَصَرَ ٱلْعَهْدُ ٱلدَّاوُدِيُّ سِلْسِلَةَ نَسَبِ ٱلْجُزْءِ ٱلرَّئِيسِيِّ مِنَ ٱلنَّسْلِ وَأَعْطَاهُ ٱلْحَقَّ فِي ٱلْحُكْمِ عَلَى ٱلْأَرْضِ لِتَكُونَ إِنْجَازَاتُ ٱلْمَلَكُوتِ أَبَدِيَّةً .‏