Jehoiada (son of Benaiah) and Abiathar succeeded Ahithophel. Joab was the commander of the royal army.