Chemical secretions are one of the main defensive mechanisms in insects. The osmeterium is a unique organ in larvae of Papilionidae (Lepidoptera), which is everted upon disturbance, secreting odoriferous volatiles. Here, using larvae of the specialized butterfly Battus polydamas archidamas (Papilionidae: Troidini), we aimed to understand the mode of action of the osmeterium, the chemical composition of the secretion, the origin of the secreted volatiles, as well as its defensive efficacy against a natural predator. We described the morphology, ultramorphology, structure, ultrastructure, and chemistry of this defensive organ. Additionally, behavioral assays of the osmeterial secretion against a predator were developed. We showed that the osmeterium is composed of tubular arms (made up by epidermal cells) and of two ellipsoid glands, which possess a secretory function. The eversion and retraction of the osmeterium are dependent on the internal pressure generated by the hemolymph, and by longitudinal muscles that connect the abdomen with the apex of the osmeterium. Germacrene A was the main compound present in the secretion. Minor amounts of monoterpenes (sabinene and ß-pinene) and sesquiterpenes ((E)-β-caryophyllene, selina-3,7(11)-diene, and other not identified compounds) were also identified. Only sesquiterpenes (with the exception of ((E)-β-caryophyllene) are likely to be synthesized in the osmeterium-associated glands. Furthermore, the osmeterial secretion showed an effective repellent effect on predators. Our results suggest that the osmeterium, besides serving as an aposematic warning for enemies, is an efficient chemical defense, with its own synthesis of irritant volatiles.