Alternaria rot, caused by Alternaria alternata, is one of the most destructive diseases of pitahaya (Hylocereus spp.). We investigated the effect of the essential oil of Baccharis dracunculifolia (Asteraceae) (EOB) in the control of A. alternata. Two studies were performed in Petri dishes containing potato dextrose agar medium amended with concentrations of the EOB ranging from 5 to 1,000 µg mL-1 (first study) and from 30 to 2,000 µg mL-1. The diameter of the fungal colony was recorded daily. These data were used to calculate the the area under the mycelial growth progress curve (AUMGPC) and mycelial growth index (MGI). In the third study, the control of Alternaria rot in pitahaya fruits by EOB was investigated by adding the EOB into an edible coat based on cassava starch and sorbitol which was prepared in Tween 20. Three treatments, containing EOB at 500, 1,000 or 2,000 µg mL-1, were assessed. Two additional treatments, one containing water and another containing only the edible coating served as controls. Pitahaya fruits were immersed in those solutions for 10 min, allowed to dry and inoculated with A. alternata 48 h later. The EOB was found to inhibit the mycelial growth and a negative and quadratic model best described the relationship of the EOB concentrations with MGI and AUMGPC. Results from the experiment performed with pitahaya fruits showed that Alternaria rot was decreased with increasing EOB concentrations. Therefore, EOB is a promising and ecofriendly method that may be included in the management of Alternaria rot in pitahya.