Avicenna's analysis of the definition of substance and accident repeatedly emphasizes two points: one and the same essence cannot be substance in one instance and accident in another; whether x is extrinsic or intrinsic for an underlying subject, y does not tell us anything as to whether x is substance or not. Both points are development in an argument against certain unnamed people who claimed the opposite. In this article I will show that Avicenna's opponents are to be identified with the mainstream Baghdad Peripatetic School (Ibn Suwar, Ibn al-Tayyib) which based itself on the Late Antique rule that "parts of substances are substances". As for Avicenna's own position, it was developed on the basis of the heterodox position of Yahya b. Adi, who anticipated Avicenna's first point. This is a further piece of evidence for something that has only recently begun to be appreciated: the influence of Ibn Adi on Avicenna.