Natural products, especially the essential oils of plants, play an important role in the discovery of new antibacterial agents. The present study investigates the chemical composition and antibacterial activity of the essential oil from the aerial part (leaves and stems) of Croton heliotropiifolius Kunth (Euphorbiaceae) from the Três Lagoas community in Amargosa, Bahia state, Brazil. Specimens of Croton heliotropiifolius of this community have not previously been investigated but are largely employed in popular medicine. The essential oil of C. heliotropiifolius was obtained by hydrodistillation in a Clevenger-type apparatus, and its chemical composition was determined by gas chromatography-flame ionization detector (GC-FID) and gas chromatography–mass spectrometry (GC–MS). The antibacterial effect was determined by a microdilution assay. (E)-caryophyllene (23.85±0.36%), γ-muurolene (10.52±0.05%) and viridiflorene (8.08±0.11%) were identified as the major oil constituents. The essential oil of C. heliotropiifolius exhibited inhibitory activity against Bacillus subtilis and Staphylococcus aureus with minimum inhibitory concentration (MIC) values of 62.5 and 500.0μgmL−1, respectively. These results showed that the essential oil of aerial part of C. heliotropiifolius could be a promising alternative for future assays against multiresistant strains of Staphylococcus ssp. and Bacillus ssp., and it could also be used as natural preservative in the food industry for the control of pathogenic bacteria. Moreover, this specie could be cultivated on a large commercial scale for the production of antibacterial essential oil.