Ahimelech in Wikipedia

(Hebrew: אחימלך "the [divine] king is brother"),[1] the son of Ahitub and father of Abiathar (1 Sam. 22:20-23), described erroneously in 2 Sam. 8:17 as the son of Abiathar and in four places in 1 Chronicles.[1] He descended from Eli in the line of Ithamar. In 1 Chr. 18:16 his name is Abimelech according to the Masoretic Text,[1] and is probably the same as Ahiah (1 Sam. 14:3, 18). He was the twelfth high priest, and officiated at Nob., where he was visited by David (to whom and his companions he gave five loaves of the showbread) when he fled from Saul (1 Sam. 21:1-9). He was summoned into Saul's presence, and accused, on the information of Doeg the Edomite, of disloyalty because of his kindness to David; whereupon the king commanded that he, with the other priests who stood beside him (86 in all), should be put to death. This sentence was carried into execution by Doeg in the most cruel manner (1 Sam. 22:9-23). Possibly Abiathar had a son also called Ahimelech, or the two names, as some think, may have been accidentally transposed in 2 Sam. 8:17; 1 Chr. 18:16, marg.; 24:3, 6, 31. According to the Jewish Encyclopedia on David descendant Jehoash of Judah: In Rabbinical Literature: As the extermination of the male descendants of David was a divine retribution for the extermination of the priests by David (comp. I Sam. xxii. 17-21), Joash escaped death because in the latter case one priest, Abiathar, survived (Sanh. 95b). Part of the curse on the House of Eli-that none of Eli's male descendants would live to old age-was fulfilled with the death of Ahimelech; the other part of the Curse on the House of Eli-that the priesthood would pass out of his descendants-was fulfilled when Abiathar was deposed from the office of High Priest.

Read More about Ahimelech in Wikipedia