One of the first mentions of the word translated as king ["melek" (H4428) in Hebrew] and the first mention of the word translated as priest ["kohen" (H3548) in Hebrew] are found together concerning Melchizedek, King of Salem in Genesis 14.
And the king of Sodom went out to meet him, after he returned from the slaughter of Chodollogomor, and the kings with him, to the valley of Saby; this was the plain of the kings.
And Melchisedec king of Salem brought forth loaves and wine, and he was the priest of the most high God. And he blessed Abram, and said, Blessed be Abram of the most high God, who made heaven and earth, and blessed be the most high God who delivered thine enemies into thy power. And Abram gave him the tithe of all.
(Genesis 14:17-20 Brenton)
The name "Melchizedek" [(G3198) in Greek; (H4442) in Hebrew] means king of righteousness, and it only appears twice in the Old Testament: first, in the above passage, and second in Psalm 110. The Hebrew word translated as "Salem" (H8004) means peace.
A Priestly King
This first mention of this person primarily addresses Melchizedek's kingship, given that the entire chapter speaks of kings in confederacy battling with one another, and Abraham, coming to the rescue of his nephew Lot, being delivered from his enemies, and met by the King of Righteousness, King of Peace.
And then it secondly addresses his priesthood, bringing forth bread and wine, being identified as the priest of the Most High God, blessing Abraham, and receiving a tithe of all from him.
Now consider the second mention of Melchizedek in Psalm 110:
A Psalm of David. The Lord said to my Lord, Sit thou on my right hand, until I make thine enemies thy footstool.
The Lord shall send out a rod of power for thee out of Sion: rule thou in the midst of thine enemies.
With thee is dominion in the day of thy power, in the splendours of thy saints: I have begotten thee from the womb before the morning.
The Lord sware, and will not repent, Thou art a priest for ever, after the order of Melchisedec.
The Lord (YHVH) at thy right hand has dashed in pieces kings in the day of his wrath. He shall judge among the nations, he shall fill up the number of corpses, he shall crush the heads of many on the earth. He shall drink of the brook in the way; therefore shall he lift up the head.
(Psalms 110:1-7 Brenton)
Notice the following elements in this psalm: David's Lord is seated at the right hand of God, while God delivers him from his enemies.
This Lord has been given power, authority to rule (with the statement, rule thou...), and dominion in the day of his power, indicating the role of a king. He is identified as being a son to God, by the statement I have begotten thee from the womb..., and is declared a priest forever, referring to Melchizedek.
The Christ, the Son of God
We're also told in Psalm 110 that kings shall be dashed into pieces in the day of his wrath, and he will judge among the nations. Now, consider Psalm 2.
In this psalm we see a clear mention of "Christ" ["christos" (G5547) in Greek; "mashiyach" (H4899) in Hebrew, often translated as "Messiah"], which means anointed or anointed one, and he is being identified as the Son of God:
Wherefore did the heathen rage, and the nations imagine vain things? The kings of the earth stood up, and the rulers gathered themselves together, against the Lord, and against his Christ; saying, Let us break through their bonds, and cast away their yoke from us.
He that dwells in the heavens shall laugh them to scorn, and the Lord shall mock them. Then shall he speak to them in his anger, and trouble them in his fury. But I have been made king by him on Sion his holy mountain, declaring the ordinance of the Lord: the Lord said to me, Thou art my Son, to-day have I begotten thee. Ask of me, and I will give thee the heathen for thine inheritance, and the ends of the earth for thy possession. Thou shalt rule them with a rod of iron; thou shalt dash them in pieces as a potter's vessel.
Now therefore understand, ye kings: be instructed, all ye that judge the earth. Serve the Lord with fear, and rejoice in him with trembling. Accept correction, lest at any time the Lord be angry, and ye should perish from the righteous way: whensoever his wrath shall be suddenly kindled, blessed are all they that trust in him.
(Psalms 2:1-12 Brenton)
According to the promises made by YHVH to Abraham, Isaac and Jacob, they were told there would be kings, who would come from their loins, they would be given their own land, and all the nations of the earth would be blest in their seed.
When the children of Israel were in Egypt, and YHVH saw the affliction of his people, He chose to send Moses to Pharaoh to tell him to let His people go, and Moses was to bring them out. We read in Exodus 4, YHVH referred to His people as his firstborn:
And the Lord said to Moses, When thou goest and returnest to Egypt, see--all the miracles I have charged thee with, thou shalt work before Pharao: and I will harden his heart, and he shall certainly not send away the people.
And thou shalt say to Pharao, These things saith the Lord, Israel is my first-born. And I said to thee, Send away my people, that they may serve me: now if thou wilt not send them away, see, I will slay thy fir-born son.
(Exodus 4:21-23 Brenton)
After Moses brought the children of Israel out of Egypt, we see another promise made by YHVH concerning these people:
And in the third month of the departure of the children of Israel out of the land of Egypt, on the same day, they came into the wilderness of Sina. And they departed from Raphidin, and came into the wilderness of Sina, and there Israel encamped before the mountain.
And Moses went up to the mount of God, and God called him out of the mountain, saying, These things shalt thou say to the house of Jacob, and thou shalt report them to the children of Israel. Ye have seen all that I have done to the Egyptians, and I took you up as upon eagles' wings, and I brought you near to myself. And now if ye will indeed hear my voice, and keep my covenant, ye shall be to me a peculiar people above all nations; for the whole earth is mine. And ye shall be to me a royal priesthood and a holy nation: these words shalt thou speak to the children of Israel.
And Moses came and called the elders of the people, and he set before them all these words, which God appointed them. And all the people answered with one accord, and said, All things that God has spoken, we will do and hearken to: and Moses reported these words to God.
(Exodus 19:1-8 Brenton)
In the following chapter, we see YHVH spoke to the people on Mt Sinai, and after the ten commandments were spoken, the people were in fear, asking Moses to speak to them as opposed to God, lest they die.
And all the people perceived the thundering, and the flashes, and the voice of the trumpet, and the mountain smoking; and all the people feared and stood afar off, and said to Moses, Speak thou to us, and let not God speak to us, lest we die.
And Moses says to them, Be of good courage, for God is come to you to try you, that his fear may be among you, that ye sin not. And the people stood afar off, and Moses went into the darkness where God was.
(Exodus 20:18-21 Brenton)
According to Moses' words in Deuteronomy, we see that YHVH had also said at this time the following:
And the Lord heard the voice of your words as ye spoke to me; and the Lord said to me, I have heard the voice of the words of this people, even all things that they have said to thee. They have well said all that they have spoken. O that there were such a heart in them, that they should fear me and keep my commands always, that it might be well with them and with their sons for ever.
(Deuteronomy 5:28-29 Brenton)
Then according to The Israelite Samaritan Version of the Torah, the words we see in Deuteronomy 18, were actually spoken at this point as well:
I will raise up to them a prophet of their brethren, like thee; and I will put my words in his mouth, and he shall speak to them as I shall command him. And whatever man shall not hearken to whatsoever words that prophet shall speak in my name, I will take vengeance on him. But the prophet whosoever shall impiously speak in my name a word which I have not commanded him to speak, and whosoever shall speak in the name of other gods, that prophet shall die.
But if thou shalt say in thine heart, How shall we know the word which the Lord has not spoken? Whatsoever words that prophet shall speak in the name of the Lord, and they shall not come true, and not come to pass, this is the thing which the Lord has not spoken; that prophet has spoken wickedly: ye shall not spare him.
(Deuteronomy 18:18-22 Brenton)
Then YHVH proceeds to give Moses instruction concerning making gods of silver and gold and the building of altars:
And the Lord said to Moses, Thus shalt thou say to the house of Jacob, and thou shalt report it to the children of Israel, Ye have seen that I have spoken to you from heaven. Ye shall not make to yourselves gods of silver, and gods of gold ye shall not make to yourselves.
Ye shall make to me an altar of earth; and upon it ye shall sacrifice your whole burnt-offerings, and your peace-offerings, and your sheep and your calves in every place, where I shall record my name; and I will come to thee and bless thee. And if thou wilt make to me an altar of stones, thou shalt not build them hewn stones; for thou hast lifted up thy tool upon them, and they are defiled. Thou shalt not go up to my altar by steps, that thou mayest not uncover thy nakedness upon it.
(Exodus 20:22-26 Brenton)
And the following three chapters outline the remaining ordinances God gave Moses that day to instruct the people, and the promise that Israel would be a royal priesthood and a holy nation is reiterated:
If ye will indeed hear my voice, and if thou wilt do all the things I shall charge thee with, and keep my covenant, ye shall be to me a peculiar people above all nations, for the whole earth is mine; and ye shall be to me a royal priesthood, and a holy nation: these words shall ye speak to the children of Israel, If ye shall indeed hear my voice, and do all the things I shall tell thee, I will be an enemy to thine enemies, and an adversary to thine adversaries.
(Exodus 23:22 Brenton)
Notice this promise is conditional. It hinges on their obedience and the keeping of the covenant YHVH was making with them on that day.
The Sin of the Golden Calf
After accepting the covenant with YHVH that day, the people did not do all the things He charged them. They broke the covenant when Moses had gone up to the mountain to get the stone tablets. Aaron was left in charge, and he was instrumental in their sin.
And the Lord said to Moses, Come up to me into the mountain, and be there; and I will give thee the tables of stone, the law and the commandments, which I have written to give them laws. And Moses rose up and Joshua his attendant, and they went up into the mount of God. And to the elders they said, Rest there till we return to you; and behold, Aaron and Or are with you: if any man have a cause to be tried, let them go to them.
And Moses and Joshua went up to the mountain, and the cloud covered the mountain. And the glory of God came down upon the mount Sina, and the cloud covered it six days; and the Lord called Moses on the seventh day out of the midst of the cloud. And the appearance of the glory of the Lord was as burning fire on the top of the mountain, before the children of Israel. And Moses went into the midst of the cloud, and went up to the mountain, and was there in the mountain forty days and forty nights.
(Exodus 24:12-18 Brenton)
And when the people saw that Moses delayed to come down from the mountain, the people combined against Aaron, and said to him, Arise and make us gods who shall go before us; for this Moses, the man who brought us forth out of the land of Egypt—we do not know what is become of him.
And Aaron says to them, Take off the golden ear-rings which are in the ears of your wives and daughters, and bring them to me. And all the people took off the golden ear-rings that were in their ears, and brought them to Aaron. And he received them at their hands, and formed them with a graving tool; and he made them a molten calf, and said, These are thy gods, O Israel, which have brought thee up out of the land of Egypt.
And Aaron having seen it built an altar before it, and Aaron made proclamation saying, To-morrow is a feast of the Lord. And having risen early on the morrow, he offered whole burnt-offerings, and offered a peace-offering; and the people sat down to eat and drink, and rose up to play.
And the Lord spoke to Moses, saying, Go quickly, descend hence, for thy people whom thou broughtest out of the land of Egypt have transgressed; they have quickly gone out of the way which thou commandedst; they have made for themselves a calf, and worshipped it, and sacrificed to it, and said, These are thy gods, O Israel, who brought thee up out of the land of Egypt. And now let me alone, and I will be very angry with them and consume them, and I will make thee a great nation.
And Moses prayed before the Lord God, and said, Wherefore, O Lord, art thou very angry with thy people, whom thou broughtest out of the land of Egypt with great strength, and with thy high arm? Take heed lest at any time the Egyptians speak, saying, With evil intent he brought them out to slay them in the mountains, and to consume them from off the earth; cease from thy wrathful anger, and be merciful to the sin of thy people, remembering Abraam and Isaac and Jacob thy servants, to whom thou hast sworn by thyself, and hast spoken to them, saying, I will greatly multiply your seed as the stars of heaven for multitude, and all this land which thou spokest of to give to them, so that they shall possess it for ever.
And the Lord was prevailed upon to preserve his people. And Moses turned and went down from the mountain, and the two tables of testimony were in his hands, tables of stone written on both their sides: they were written within and without. And the tables were the work of God, and the writing the writing of God written on the tables.
We see Moses mediated at this point on behalf of the people, calling for God's mercy and drawing His attention to the promises He made to his fathers. Then, YHVH prevailed upon to preserve his people.
And Joshua having heard the voice of the people crying, says to Moses, There is a noise of war in the camp. And Moses says, It is not the voice of them that begin the battle, nor the voice of them that begin the cry of defeat, but the voice of them that begin the banquet of wine do I hear. And when he drew nigh to the camp, he sees the calf and the dances; and Moses being very angry cast the two tables out of his hands, and broke them to pieces under the mountain. And having taken the calf which they made, he consumed it with fire, and ground it very small, and scattered it on the water, and made the children of Israel to drink it.
And Moses said to Aaron, What has this people done to thee, that thou hast brought upon them a great sin? And Aaron said to Moses, Be not angry, my lord, for thou knowest the impetuosity of this people. For they say to me, Make us gods, which shall go before us; for as for this man Moses, who brought us out of Egypt, we do not know what is become of him. And I said to them, If any one has golden ornaments, take them off; and they gave them me, and I cast them into the fire, and there came out this calf.
And when Moses saw that the people was scattered, --for Aaron had scattered them so as to be a rejoicing to their enemies, -- then stood Moses at the gate of the camp, and said, Who is on the Lord's side? let him come to me. Then all the sons of Levi came to him. And he says to them, Thus saith the Lord God of Israel, Put every one his sword on his thigh, and go through and return from gate to gate through the camp, and slay every one his brother, and every one his neighbour, and every one him that is nearest to him. And the sons of Levi did as Moses spoke to them, and there fell of the people in that day to the number of three thousand men.
And Moses said to them, Ye have filled your hands this day to the Lord each one on his son or on his brother, so that blessing should be given to you. And it came to pass after the morrow had begun, that Moses said to the people, Ye have sinned a great sin; and now I will go up to God, that I may make atonement for your sin.
And Moses returned to the Lord and said, I pray, O Lord, this people has sinned a great sin, and they have made for themselves golden gods. And now if thou wilt forgive their sin, forgive it; and if not, blot me out of thy book, which thou hast written.
And the Lord said to Moses, If any one has sinned against me, I will blot them out of my book. And now go, descend, and lead this people into the place of which I spoke to thee: behold, my angel shall go before thy face; and in the day when I shall visit I will bring upon them their sin. And the Lord smote the people for the making the calf, which Aaron made.
(Exodus 32:1-35 Brenton)
As a result of their sin, Moses executed judgment. He had the men who claimed to be on the Lord's side come to him, and he instructed them to put on their swords and go through and return from gate to gate through the camp and slay every one his brother, every one his neighbour, and every one him that is nearest to him. And the sons of Levi did as Moses instructed.
Then Moses sought YHVH to make atonement for the sin of Israel asking forgiveness for the people. He then demonstrated his willingness to lay down his life for them, stating if YHVH would not forgive them this sin, that YHVH would blot him out of the book, which He has written. But YHVH decreed, If any one has sinned against me, I will blot them out of my book.
It was after this that the people were charged to build a tabernacle unto YHVH, to equip it with particular furnishings, to design priestly garments, and then to consecrate Aaron and his sons to stand as priests in ministry to YHVH.