Abiathar, son of Ahimelech, escaped when
Saul ordered the priests of Nob killed for assisting
David. He fled to David carrying an ephod and became a priest associated with David throughout his years of conflict and kingship. Abiathar and Zadok served together and remained in Jerusalem during Absalom's rebellion at David's instruction. Near David's death, however, Abiathar supported Adonijah's attempt to take the throne.
Solomon spared his life because he had shared David's hardships but banished him to Anathoth and removed him from priestly service.