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 and origin of the secretion, as well as its defensive efficiency against a natural predator. We described osmeterium’s morphology, ultramorphology, structure, ultrastructure, and chemistry. 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 monoterpenes (sabinene and ß-pinene) and sesquiterpenes ((E)-β-caryophyllene, selina-3,7(11)-diene, and other some unidentified compounds) were also detected. Only sesquiterpenes (with the exception of (E)-β-caryophyllene) are likely to be synthesized in the osmeterium-associated glands. Furthermore, the osmeterial secretion proved to deter predatory ants. 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.