Rabbi Yochanan ben Nuri taught that the priesthood did not begin with Aaron. It began with Noah's son.

"The Holy One, blessed be He," the Rabbi said, "set aside Shem, separating him to serve as priest before Him. He caused His Shechinah β€” His indwelling Presence β€” to rest upon him, and renamed him Melchizedek, priest of the Most High and king of Salem."

Shem opened a school. His brother Japheth studied there. Centuries later, when Abraham came out of Ur, carrying in his mind everything his father Terah had taught him about stars and idols, he walked into the study hall of Shem β€” and God Himself became his teacher. What Abraham had learned from the lips of men was forgotten. What he received from the Shechinah replaced it.

And Abraham, grateful, did something no one had done before: he prayed that the Divine Presence would never depart from the house of Shem. That prayer was heard. It was sealed in a single verse, the one that Psalms would later address to David and to every king in his line (Psalms 110:4): Thou art a priest forever after the order of Melchizedek.

Every Israelite priesthood, the midrash is saying, is rooted in a school the first patriarch prayed into permanence. The beit midrash is older than the Tabernacle.