From Middle Low German afgot or Old English afgod, compare German Abgott. Second element is gud (“god”).
afgud