The invention relates to aminoquinazoline compounds or the enantiomers or veterinarily acceptable salts thereof which are useful for combating or controlling invertebrate pests, in particular arthropod pests and nematodes. The invention also relates to methods for controlling invertebrate pests by using these compounds and to plant propagation material and to agricultural and veterinary compositions comprising said compounds. wherein A1, A2, A3, A4, R1, R2, R3, R4, R5a, R5b, R5c, R5d and p are defined as in the description.