The king then appointed Benaiah, son of Jehoiada, to replace Joab as commander of the army. King Solomon also replaced Abiathar with the priest Zadok.