With the help of Zadok a descendant of Eleazar and Ahimelech a descendant of Ithamar, David separated them into divisions for their appointed order of ministering.
A larger number of leaders were found among Eleazar's descendants than among Ithamar's, and they were divided accordingly: sixteen heads of families from Eleazar's descendants and eight heads of families from Ithamar's descendants.
They divided them impartially by drawing lots, for there were officials of the sanctuary and officials of God among the descendants of both Eleazar and Ithamar.
The scribe Shemaiah son of Nethanel, a Levite, recorded their names in the presence of the king and of the officials: Zadok the priest, Ahimelech son of Abiathar and the heads of families of the priests and of the Levites--one family being taken from Eleazar and then one from Ithamar.
This was their appointed order of ministering when they entered the temple of the LORD, according to the regulations prescribed for them by their forefather Aaron, as the LORD, the God of Israel, had commanded him.
They also cast lots, just as their brothers the descendants of Aaron did, in the presence of King David and of Zadok, Ahimelech, and the heads of families of the priests and of the Levites. The families of the oldest brother were treated the same as those of the youngest.