Although grilled meat products are popular worldwide, high-temperature processes, such as grilling and frying, are highly likely to produce heterocyclic amines (HAs), which are considered to be a class of mutagenic and carcinogenic chemicals. In this study, the inhibitory effects of different spices (star anise, alpinia galanga, and black pepper at 0.5,1.0 and 1.5%, w/w, respectively) on carcinogenic and HAs in the roast barbecued pork were studied by principal component analysis (PCA). Three types of HAs from imidazopyridine (PhIP) and beta-carboline (Harman and Norharman) were detected and quantified from the barbecued pork, respectively. According to PCA results, differing spice concentrations significantly prevented the development of Harman and Norharman in barbecued pork, but promoted the formation of PhIP. Especially, high concentrations of all three spices (1.5%) presented the best inhibition of Norharman with 66%, 66%, and 63%, respectively. In addition, the total phenol content (TPC) of spices showed a highly significant positive correlation with antioxidant capacity, while a negative correlation with the total HAs content (r = - 0.706%, P < 0.01). The obtained results indicated that phenolic substances and spices (star anise, alpinia galanga, and black pepper) could inhibit the generation of HAs in barbecued pork. The results of this study may provide an effective way to reduce the concentration of HAs in the processing of meat products.