2 Samuel 8:17

And Zadok the son of Ahitub, and Ahimelech the son of Abiathar, were the priests; and Seraiah was the scribe;

The list records Zadok the son of Ahitub and Ahimelech the son of Abiathar as priests, the two serving together as high priests, while Seraiah held the office of scribe. Abiathar, whose son is named in that joint priesthood, was afterward deposed by Solomon.

The setting is the height of David's enlarged dominion, when he controlled the Syrian kingdom and Damascus and had pushed his frontier eastward to the Euphrates, though perhaps not beyond it. His rule then embraced nearly all the promised land with the exception of Tyre. That prosperity and territorial expansion came before David's fall into sin.

The verse also belongs to the record showing that Israel did not keep the earlier prohibition but afterward practiced the forbidden practices.