The apple maggot (Rhagoletis pomonella), also known as the railroad worm (but distinct from the Phrixothrix beetle larva, also called railroad worm), is a species of fruit fly, and a pest of several types of fruits, especially apples. This species evolved about 150 years ago through a sympatric shift from the native host hawthorn to the domesticated apple species Malus domestica in the northeastern United States. This fly is believed to have been accidentally spread to the western United States from the endemic eastern United States region through contaminated apples at multiple points throughout the 20th century. The apple maggot uses Batesian mimicry as a method of defense, with coloration resembling that of the forelegs and pedipalps of a jumping spider (family Salticidae). The adult form of this insect is about long, slightly smaller than a housefly. The larva, which is the stage of this insect's lifecycle that causes the actual damage to the fruit, is similar to a typical fly larva or maggot. Caterpillars, especially the larvae of the codling moth, that infest the insides of apples are often confused with the apple maggot. However, these organisms generally feed in the apple's core while apple maggots feed on the fruit flesh. The apple maggot larvae are often difficult to detect in infested fruit due to their pale, cream color and small body size. The adult fly lays its eggs inside the fruit. Larvae consume the fruit and cause it to bruise, decay, and finally drop before ripening. The insect overwinters as a pupa in the soil. It only emerges after metamorphosis into a relatively defenseless fly. Adults emerge from late June through September, with their peak flight times occurring in August. Description Eggs are fusiform and pearly white when laid in fruit, but after a short period of time in the fruit, they turn a cream color. Developing larvae can be clearly seen within the translucent eggs. The larva is white or cream-colored, but if it eats green pulp near the fruit skin, the green shows through the skin. Larvae range in length from 7 to 8.5 mm and in width from 1.75 to 2 mm. The pupa is formed inside the larval skin, after the maggot shortens and becomes inactive. During the pupal stage, the larva is initially light yellow, but turns yellow-brown within hours and darkens. The pupae range in length from 4 to 5 mm and