Osmeterium

The osmeterial organ remains inside the body in the thoracic region in an inverted position and is everted when the larva is disturbed in any way emitting a foul, disagreeable odor which serves to repel ants,[2] small spiders[3] and mantids.

[4] To humans, this odour is rather strong but not unpleasant, usually smelling like a concentrated scent of the caterpillar's food plant and pineapple.

The fine structure of the osmeterium gland of Papilio larvae consists of the following cell types.

[4] The secretion of Papilio demodocus pre-final larval instar contains methyl 3-hydroxybutanoate, 3-hydroxybutanoic acid, α-pinene, myrcene, limonene, β-phellandrene, (Z)-ocimene, (E)-ocimene, β-caryophyllene, (E)-β-farnesene, and germacrene A, as well as a number of unidentified sesquiterpenoids.

That of Sericinus montela (Parnassiinae, Zerynthiini) was characterized as monoterpene hydrocarbons comprising β-myrcene (major), α-pinene, sabinene, limonene, and β-phellandrene, and of Pachliopta aristolochiae (Papilioninae, Troidini) was composed of numerous sesquiterpene hydrocarbons, including α-himachalene, α-amorphene, and germacrene A, and a few oxygenated sesquiterpenoids.

Osmeterium of Papilio xuthus Larva.
Upper: Osmeterium partly everted. Lower: undisturbed
Papilio demodocus larva everting its osmeterium fully, and with one horn applying the repugnatorial secretion to the finger that irritated it